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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -