0

I'm really new to Jquery so I really need a some help from you guys.

I have created a button, when clicked a pop up menu will appear. Now I have created a script, what it does is when that button is clicked the sideshow on the site background will be hidden (this is to make the pop up menu much smoother), my question is after a user closes down the pop up menu, how can I reshow the hidden slideshow again , I believe it has something to do with this code onHide: function()

<script>
jQuery(document).ready(function(){
    jQuery('.menubutton').click(function(){
        jQuery("#slideshow").css({"display":"none"});
    });
});
</script>
1

2 Answers 2

3

To show and hide alternatively use .toggle()

jQuery("#slideshow").toggle()

Demo: Fiddle

To Hide an element use .hide()

jQuery("#slideshow").hide()

To Display a hidden an element use .show()

jQuery("#slideshow").show()
Sign up to request clarification or add additional context in comments.

1 Comment

Hi thanks for the reply,I checked the fiddle demo so the user has to again click on that button to hide a div, the thing is this is a pop up, the user can click anywhere on the screen to close that pop up
1

I believe jQuery.toggle() is what you are after:

jQuery(document).ready(function () {
    jQuery('.menubutton').click(function () {
        jQuery('#slideshow').toggle();
    });
});

Fiddle: http://jsfiddle.net/QGdLw/1/

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.