views:

242

answers:

2

I have a div with WIDTH 100% and position fixed on the top of the page. It covers the vertical scrollbar in IE when vertical scrolling is needed on the html.

What can I do to avoid this (I can't change the position fixed bit)?

Can I detect whether page need vertical scrolling onload/resize and change that static div's width using jQuery?

or

Solve it through CSS altogether?

+1  A: 

found the problem, i've accidentally attached overflow:auto on the body tag, when it is only meant for the html tag.

Brandon
A: 

It is kinda hard to tell without seeing the page, but could you add a conditional stylesheet and move the div over 5px or so in ie so that doesn't happen? right:5px

The jquery code for this would be something like:

if ($(window).height() < $(document).height()) {
   $('#myDiv').css('left', '5px');
}
CEich