Solved

JQuery scrollbar issue with IE

Posted on 2012-03-13
2
417 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 250 total points
ID: 37722225
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
ID: 37727296
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Need help Creating PowerShell Script 4 46
Popup write two lines 3 22
Two decimal 5 29
How to pass values to HTML-5 attribute dynamically? 24 51
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 will show, step by step, how to integrate R code into a R Sweave document
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

726 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