html - Jquery on ready function not doing anything -
following tutorial uses jquery document ready function can't bit work or anything. threw in alert , won't trigger idea i'm doing wrong? thanks.
<html> <head> <title>coulthard</title> <link rel=stylesheet href="blanket.css" type="text/css" media=screen> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { alert("works"); $("#slideshow").css("overflow", "hidden"); $("#slideshownav").css("visibility", "visible"); $("#slideshownav a[href=#image1]".addclass("active"); $("#slideshownav").localscroll({ target:'#slideshow', axis: 'x' }); $("#slideshownav a").click(function(){ $("#slideshownav a").removeclass("active"); $(this).addclass("active"); }); }); </script>
there closing braket missing, after a[href=#image1]
.
change
`$("#slideshownav a[href=#image1]".addclass("active");`
to
`$("#slideshownav a[href=#image1]").addclass("active");`
and should see alert.
ps: using outdated version of jquery. please forward use current version 1.9.1 on new projects.
Comments
Post a Comment