开发者

The bounce effect in jquery is not working?

开发者 https://www.devze.com 2023-02-24 23:47 出处:网络
I\'m having trouble getting my bounce effect to work when I click on an image using JQuery. It just won\'t bounce. I\'ve provided my code below.

I'm having trouble getting my bounce effect to work when I click on an image using JQuery. It just won't bounce. I've provided my code below.

<script type="text/javascript" src="js/jquery.js"></script>

<a href="#"><img id="cog" src="images/icons/cog.png" alt="User Settings"/></a>

$(document).ready(fun开发者_运维百科ction() {
    $("#cog").click(function() {
        $(this).effect("bounce", {times: 3}, 500);
    });
});


That's because it's part of the jQuery UI package.

Try adding this line

<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"></script>


Effects are part of jQueryUI, not jQuery.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号