JQuery scrollbar issue with IE
Posted on 2012-03-13
I am trying to use JQuery to load an html page into a <div> when a button is clicked. This all worked fine with Chrome/Safari, but in IE I noticed that when the inserted html page was smaller than the <div> size, the scrollbars did not appear like they did in Safari/Chrome.
i finally figured this out, i had the style property display:none set on the <div>. When I removed this setting the scrollbars worked in all browsers, with no other side effects.
The problem I have now is that when I fire another JQuery function to hide the <div> using either hide() or slideUp(), the <div> does hide, but JQuery has now applied a style property using display:none, which means if I then re-open the <div> the scrollbars have disappeared.
As I said before this is just IE (I am using v9), does anyone know how to prevent this from happening?
I have also tried removing the 'style' attribute from the <div> using removeAttr(), then recreating the same attributes as before using attr(), but the scrollbars are still missing.
I'm pulling my hair out, please can somebody help me?
Thanks in advance.