Skip to content Skip to sidebar Skip to footer

Firefox Makes Simple Jquery Slidetoggle() Disappear

They wanted to have a simple toggle open close accordion like interaction. Not trying to reinvent the wheel but just trying to learn jquery/javascript. Everything is going smooth

Solution 1:

Change js code like this

$(".x-button").click(function () {
  $(".inner-info-container").slideToggle("slow");
  $(this).toggleClass("x-button p-button");
  returnfalse;//insert this line
});

Solution 2:

You need to add return false after the $(this).toggleClass("x-button p-button");return false just means it doesn't try to go to the href, it stops the normal link behavior.

Post a Comment for "Firefox Makes Simple Jquery Slidetoggle() Disappear"