jQuery slideToggle function slids a div down then immediately back up
Asked Answered
P

1

6

I have a very simple slide toggle function as below.

$(".quickLinksLink").click(function () {
    $(".quickLInksList").slideToggle(100);  
});

It works but it slides the quickLInksList div down and then immediately back up. Sort of like peeka boo effect. this happen everywhere where a slideToggle function is used.

Any help will be appreciated.

Pali answered 22/11, 2011 at 17:25 Comment(4)
there is something you're not showing us. Your question only makes sense if you're double-clicking the link.Fluorene
code has typos; case matters. (it is not the cause here, but it's important to note that we can only debug what you give us.)Teeming
jsfiddle.net/bryanjamesross/fznGg <- Code's working here. There's something else going on.Laborious
after making this post, I looked at this page source and realized that the .js file that contains the functions was being loaded twice. I corrected this and it works as expected now.Pali
W
1

Here is a fiddle with the slideToggle method implemented: http://jsfiddle.net/IrvinDominin/R2Q86/

In my example there is a button that calls the method for a div. How do you want to fire the method?

Wheelhorse answered 22/11, 2011 at 17:44 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.