Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery slidetoggle not working? [closed]

http://jsfiddle.net/nKUgA/2/

I'm just trying to make a small box slide down from the pictureControls div which acts as a button, but slideToggle is doing nothing-- it just sort of glitches into place and back again. Read a ton of other similar questions, none helped or applied.

    $('#pictureControls').click(function(event) {
        $('#pictureControlsMenu').slideToggle(300);
        event.stopPropagation();
    });
like image 482
temporary_user_name Avatar asked Mar 18 '13 14:03

temporary_user_name


People also ask

Why slideToggle is not working?

slideToggle wasn't working because the table is not a block element. In the following update I've made it a block element (instead of display:none), and then hidden it on page load with jQuery... Nice. Probably a better fix than mine.

How to use jQuery slideToggle?

The jQuery slideToggle() method toggles between the slideDown() and slideUp() methods. If the elements have been slid down, slideToggle() will slide them up. If the elements have been slid up, slideToggle() will slide them down. $(selector).

What does slideToggle do?

The . slideToggle() method animates the height of the matched elements. This causes lower parts of the page to slide up or down, appearing to reveal or conceal the items. If the element is initially displayed, it will be hidden; if hidden, it will be shown.


1 Answers

slideToggle wasn't working because the table is not a block element. In the following update I've made it a block element (instead of display:none), and then hidden it on page load with jQuery...

http://jsfiddle.net/nKUgA/4/

like image 79
Reinstate Monica Cellio Avatar answered Sep 18 '22 00:09

Reinstate Monica Cellio