0

Possible Duplicate:
pageYOffset Scrolling and Animation in IE8

In my previous question:

A fixed div within a container

The answer and solution was:

http://jsfiddle.net/BbAck/3

After some further testing the problem I am having is that it won't work in IE8.

What am I missing here and where should I be looking to fix it?

Community
  • 1
  • 1
Anicho
  • 2,647
  • 11
  • 48
  • 76
  • 1
    http://stackoverflow.com/questions/10286162/pageyoffset-scrolling-and-animation-in-ie8 – Ashirvad Aug 21 '12 at 15:59
  • 1
    @Ashirvad Singh is correct, IE8 does not recognize the pageYOffset for height meaning you calculation always turns up false. – SciSpear Aug 21 '12 at 16:25

1 Answers1

1

Try changing:

yOffset = window.pageYOffset;

by:

yOffset = $(window).scrollTop();

And make sure your page has html5 doctype:

<!DOCTYPE html>

http://jsfiddle.net/BbAck/4/

Martin Borthiry
  • 5,256
  • 10
  • 42
  • 59