Skip to content Skip to sidebar Skip to footer

.slidetoggle() Not Working When Using Jquery 3.1.1

For some reason I am getting an Uncaught TypeError when I try and execute the following code. jQuery(function($){ $(document).ready(function() { $('.block').click(func

Solution 1:

The problem here is you are using the slim version which excludes the effects like the animation expected from slideToggle; so the function isn't defined. Just switch to the normal version.

From the Jquery Page

Slim build Sometimes you don’t need ajax, or you prefer to use one of the many standalone libraries that focus on ajax requests. And often it is simpler to use a combination of CSS and class manipulation for all your web animations. Along with the regular version of jQuery that includes the ajax and effects modules, we’ve released a “slim” version that excludes these modules. All in all, it excludes ajax, effects, and currently deprecated code.

Post a Comment for ".slidetoggle() Not Working When Using Jquery 3.1.1"