Solved

JQuery scrollbar issue with IE

Posted on 2012-03-13
2
416 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
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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
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…

792 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