Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE 7 redraw div?

Status
Not open for further replies.

jman78

Programmer
Jan 15, 2008
44
US
I set up an AJAX call in ruby. This works in all browsers except IE 7 (amusingly enough, IE 5.5 and 6 render it well)

Is there a way to redraw the div tag that the ajax updates to include the size? Here are a couple of screenshots to illustrate what it is doing.

Jason

Before AJAX call
After AJAX call

As you can see, the height of the page remains the same, while the contents of the div is updated. (since part of the updating involves a filter, the updated content is usually shorter than the original content.)
 
If your DIV is styled to be a specific height, you'd need to set its height to "auto", or a better value.

Ask in forum215 if you need more help with this.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
No... setting the height to 'auto' doesn't work. The issue I'm having is that IE7 isn't redrawing the div after the ajax postback, so the page stays the same size (i.e. - all the data) instead of 'shrinking to fit' the reposted data. The initial solution I thought up was to force a refresh of the div, but that isn't working.

I'm using the 'onchange' event and executing the following code:

Code:
onchange ::
  document.getElementById('it_body').style.display = none;
  document.getElementById('it_body').style.display = block;

(Theoretically this code should have 'reset' the div and caused it to resize to its contents by changing the display property, or so I thought?)

Any help is appreciated!

Jason
 
two thoughts:

try setting to inline and then to block.
if this does not work the remove the div from the DOM and re-add it.
 
Thanks for the response... I just fixed this by filtering the results first. Not sure why that worked, but it does. Thanks be to the client who requested that change in behavior =)

jason
 
Hi, i know this was fixed, but i came across something like this today and so thought i would post it.

Apparently in IE7 to 'fix' some of the problems in earlier IE you need to set the div to be display:inline-block; which is to fix this issue.
 
hmm... seems odd, go figure IE... inline-block seems to be rather conflicting?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top