javascript - Failed to execute 'scroll' on 'Window': 2 arguments required, but only 1 present -
i have code here, gives me error.
uncaught typeerror: failed execute 'scroll' on 'window': 2 arguments required, 1 present.
i have jquery 1.8.3 installed, , script on bottom of page. code:
<script type='text/javascript'> $(window).scroll(function() { var scroll = $(window).scrolltop(); if (scroll >= 150) { $(".navigation").addclass("darkheader"); } else { $(".navigation").removeclass("darkheader"); } }); </script>
any help? on jsfiddle working. code on ipboard 3.4.8.
use
$(document).ready(function(){ }
to element after document ready
here demo
click here!
update demo notice change of scroll
click here!
Comments
Post a Comment