Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

JQuery scrollbar issue with IE

Posted on 2012-03-13
2
Medium Priority
?
423 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 1000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

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 …
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
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…
The viewer will learn how to dynamically set the form action using jQuery.

721 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