The bounce effect in jquery is not working?
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.
精彩评论