Jump to content

Ie8 & Javascript Onscroll Event Does Not Work


Recommended Posts

I am trying to get a menu to move with a page when a user scrolls. The menu isn't the problem.I put an onscroll event in the web page's body tag, but IE 8 does not seem to recognize it.This is from my code:

<body onscroll="moveButtonsGroup()" >

The function never gets called. I put a simple alert message in it as follows:

function moveButtonsGroup( ){alert("I got here.")}

I never get the alert message. This works fine in the latest version of FireFox. Does anyone have any information about this?

Link to comment
Share on other sites

What is strange is that this works in FireFox.(OK - I have been working with CSS for a couple of years now and have worked on pages that need to work for both IE and FF, so I guess I cannot use the word "strange". Things like this happen all the time! LOL)I found a couple of websites that use a different approach. Instead of using the onscroll event they use CSS positioning. I haven't examined their code in detail yet, but that looks like a better solution right now.Thanks for your reply, JustSomeGuy.==============================Yes - Using CSS positioning really worked well. I used fixed positioning. No use for the onscroll anymore.

Edited by K_Drive
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...