Jump to content

jQuery scroll function issue


sridaran

Recommended Posts

I am working in jQuery scroll function to make the header portion of webpage fixed and body portion scrollable. My code is working fine in chrome & firefox browsers. But the scroll is not working in IE8 browser. Can any one tell me that where I did mistake? Here is my script: <style type="text/css"> .nav{ z-index: 9999; position: fixed; left: 0; top: 0; width: 100%;}</style> <script>jQuery("document").ready(function($){var nav = $('.fixedhead');$(window).scroll(function () {if ($(window).scrollTop() > 0) {nav.addClass("nav");} else {nav.removeClass("nav");}});});</script>

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...