Prevent click event in jQuery triggering multiple times

后端 未结 6 612
甜味超标
甜味超标 2020-12-10 15:01

I have created a jQuery content switcher. Generally, it works fine, but there is one problem with it. If you click the links on the side multiple times, multiple pieces of c

6条回答
  •  醉话见心
    2020-12-10 15:42

    Well this is how i did it, and it worked fine.

    $(document).ready(function() {
        $(".clickitey").click(function () {
            if($("#mdpane:animated").length == 0) {
                $("#mdpane").slideToggle("slow"); 
                $(".jcrtarrow").toggleClass("arrow-open");
            }
        });
    });
    

    this is not doing what your code does ofcourse this is a code from my site, but i just like to point how i ignored the clicks that were happening during the animation. Please let me know if this is inefficient in anyway. Thank you.

提交回复
热议问题