Solved

Javascript animated DIV is really slow in IE7

Posted on 2008-06-12
4
1,238 Views
Last Modified: 2011-10-19
http://ne3d.cwtclients.co.uk/index.html

If you look at the site above. The bottom of the page has a tab (contact us), when you hover over the image a green DIV pops up. This is done by Javascript altering the height of the DIV while the css keeps bottom: 0 and position: fixed.

In FF this effect is perfect, no problems at all. However in IE7 it's really really slow. I've managed to track this down to the line in the CSS which keeps the tab at the bottom of the page (position: fixed). If I remove the line then its quick, but obviously it's not positioned at the bottom of the page anymore.

Does IE7 have a problem with position: fixed? Is there a way around this?
0
Comment
  • 2
4 Comments
 
LVL 10

Expert Comment

by:bluefezteam
ID: 21770334
Strange, it's as though the browser is constantly refreshing to make sure its at the bottom of the page.
yet when I shrink the window (not maximised) it's fine... very fast.

Can't you opt for position:absolute; top:100%;

that may work.
0
 
LVL 5

Expert Comment

by:vibrazy
ID: 21770411
I've debugged the javascript and found the following error.

Try fixing that and see if it works.

Regards,
Vibrazy
ee.gif
0
 
LVL 10

Accepted Solution

by:
bluefezteam earned 500 total points
ID: 21770423
I tried this and I was able to float a div down at the bottom of the screen across firefox and IE6.

I think position:fixed; is causing IE7 to contantly refresh itself to make sure it's got the content at the bottom and freaking out...


<style>

div{height:50px;position:absolute;top:100%;margin-top:-50px;background:#CCC;display:block;width:100%;}

</style>
 

<div>hi</div>

Open in new window

0
 

Author Comment

by:CreativewithTechnology
ID: 21770544
bluefezteam,

I had already tried your solution, it semi-works, but the problem is when there's a scrollbar on the right, and you scroll down, the bar at the bottom moves up with the scroll, rather than remaining at the bottom of the page all the time.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

708 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