Fotiman - 4:17 pm on Jun 11, 2013 (gmt 0)
But if you vertically scroll down from the top then magnify until the horizontal scroll bar appears and then use the horizontally scroll the top does not move.
Looking at the code, you're only giving it position: fixed when the scroll is not at the top of the page. Thus, when you're at the top and you scroll horizontally, the div is not fixed and scrolls with the body. But when you scroll down from the top, the div is given position: fixed, and therefore does not scroll horizontally with the page. If the goal is to get it to not scroll horizontally when at the top, then make sure it's always got position: fixed instead of removing and adding that class.