Display and hide a div onclick [closed] - javascript

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
This is a demo of a sidebar, when i click on login it should display the login form, and when i click again it should hide it.
I don't know how to do that. Any hints?
I have also another problem, the bar hide part of the content how to solve that?
Thank you very much for any help.
Demo: http://jsfiddle.net/Iuppiter/uDxH6/61/
// Clicking here will show/hide the div
Login
<div id="login-form"> ... </div>
Without using Jquery maybe.

With only the code your provided you can do this.
http://jsfiddle.net/uDxH6/62/
$("#login-form").hide();
$("#other-bar-top a:nth-child(4)").click(function(e) {
$("#login-form").slideToggle();
e.preventDefault();
});
Make sure to include jQuery on your website.

Can you try this,
HTML:
Login
Jquery:
$(function(){
$("#login-form").hide();
$("#login").click(function(){
$("#login-form").toggle();
});
});

Related

On click effect (CSS, HTML, JAVASCRIPT) [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 2 years ago.
Improve this question
I don't know how to get "onclick" effect. I mean how to open new site by click menu. Below i attached example. Please tell what can i do.
https://bslthemes.com/ryan/demo/index-new-no-photo.htm
With addEventListener you have an univerdal method to respond on the click event. Instead of <div> you may use <button> or any other element, that's up to you.
<div id="whatever">Click me</div>
<script>
document.querySelector("#whatever").addEventListener("click", function() {
window.location.replace("https://stackoverflow.com/");
});
</script>

How to make a onclick iframe make a button visible? [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
Improve this question
I cant figure out how todo this if i can get any help it would mean alot ove been stumped for the last hour looking everywhere for an awnser maybe im searching the wrong this i dont know. please help thanks!
Add this code to your page inside your iframe. The button will be hidden (see inline style css), when you click within the iframe the click event fires on the body element and displays the button. Uses jquery.
<body id="body">
<input id="Btn1" type="button" value="clickMe" style="display:none;">
</body>
$("#body").click(function(){
$("#Btn1").show();
});

JavaScript script reloader [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
Im a little new to HTML programming so I wasn't sure what to do. Im trying to make this script that I have written reload constantly (every second) without refreshing the page. I know that it is supposed to be using the tag but Im not sure what to put after. Thank you for reading, hopefully someone will help.
I think you mean reload without user interaction. You don't need javascript. Place this in <head>
<meta http-equiv="refresh" content="1" />
or if you really want to use JS, place this before </body> (or before <head/> if you're old school).
<script>
window.onload=function(){
setTimeout(function(){location.reload(false)}, 1000);
}
</script>

Facebook like button not working, suddonly showing zero [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
My blog had 101 likes, but when I saw it now, it is showing zero likes, and when I click on like button, it is not updating.
The Java script which is being used for the button is this,
<div class="fb-like" data-href="http://themadeconomy.blogspot.com" data-send="false" data-layout="button_count" data-width="450" data-show-faces="true"></div>
site : http://themadeconomy.blogspot.in
Can you try to change the data-href attribute to match your blogs address? Like this :
data-href="http://themadeconomy.blogspot.in"
Instead of :
data-href="http://themadeconomy.blogspot.com"
More about Facebook Like Button here

Add event on dynamic change of DIV [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 9 years ago.
Improve this question
I have a page (Facebook page) that has its content changing dynamically. I am writing a GM script but it only loads when the page refreshes, and this is not the case. I have tried to do something like:
mydiv.addEventListener('load', myfunc() ,false );
as I saw in a different thread, but it didn't work. What am I doing wrong?
Thanks.
Use setInterval() or the waitForKeyElements utility.
Can't give any more detail unless you provide specifics like: what, exactly, you are trying to do; before-and-after HTML; or even a link to the page and/or screenshots.
Change myfunc() to myfunc.
Using myfunc(), you are calling the function.
While myfunc is just passing the reference to your function.

Categories

Resources