Jquery Toggle two function not work in 1.10.1

前端 未结 7 1889
执念已碎
执念已碎 2020-12-17 03:04

Jquery Toggle two function not work in jquery 1.10.1 but work\'s on Jquery 1.8.3

HTML

For example, consider the HTML:

7条回答
  •  有刺的猬
    2020-12-17 03:47

    Dude it doesn't works in jQuery 1.10.1

    Still there is another way to do it...

    $(function () {
        function first() {
           //Code for first time click goes here
            $(this).one("click", second);
        }
        function second() {
            //Code for second time click goes here
            $(this).one("click", first);
        }
        $("#target").one("click", first);
    });
    

提交回复
热议问题