Solved

JQuery scrollbar issue with IE

Posted on 2012-03-13
2
412 Views
Last Modified: 2012-03-15
Hi Experts

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.
0
Comment
Question by:w1res
2 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 250 total points
Comment Utility
What is your statement to show the div ? Can you show some code

jQuerys' hide method sets the style property display to none.
The show method will remove the style property display or in later versions sets it back to what is was before hiding it.
0
 

Author Closing Comment

by:w1res
Comment Utility
Thank you, this pointed me in the right direction. As you said, it seems that different hide/reveal functions use different methods. It turns out that if I use fadeIn and fadeOut instead of slideIn and slideOut the display attribute is not affected. Problem solved.
Thanks again.
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

I found this questions asking how to do this in many different forums, so I will describe here how to implement a solution using PHP and AJAX. The logical flow for the problem should be: Write an event handler for the first drop down box to get …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now