javascript - Why isn't this jquery effect working? -
i working through course on codecademy , once finished , ran code.. worked fine, take code codecademy , set copy/paste own jquery folder reference/practice.
the goal project krypton bounce 3 times in 500ms, , script.js works in codecademy not when set locally.. know why?
index.html:
<html> <head> <title></title> <link rel="stylesheet" type="text/main" href="main.css"> </head> <body> <div></div> <script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js"></script> <script src="script.js"></script> </body> </html>
main.css:
body { background-image: url('http://bit.ly/upqgj6'); } div { height: 100px; width: 100px; border-radius: 100%; background-color: #008800; background-image: -webkit-gradient(linear, 100% 0%, 0% 100%, from(#003500), to(#008800)); background-image: -webkit-linear-gradient(left, #003500, #008800); background-image: -moz-linear-gradient(left, #003500, #008800); background-image: -ms-linear-gradient(left, #003500, #008800); background-image: -o-linear-gradient(left, #003500, #008800); }
script.js:
$(document).ready(function() { $('div').click(function() { $(this).effect('bounce', {times:3}, 500); }); });
thank reading
it seem did't include jquery core library. jquery ui won't work because depend on jquery core. put above jquery ui script code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
or can change version itself. see here version include:
https://developers.google.com/speed/libraries/devguide#jquery
Comments
Post a Comment