Link to home
Start Free TrialLog in
Avatar of RichardMass
RichardMassFlag for Australia

asked on

Fadeout page on click and render new page from link

Hi everyone,

I am currently using the script below to tell the page to fade out on click and then render the new page in its place. This works perfectly in Firefox (as usual) but in all IE versions, it fades out all content as required except for absolutely/relatively positioned DIV's. When clicked, all content fades out nicely except these positioned DIV's, once everything is faded out in the set time frame, the positioned DIV's simply flash out.

I was wondering if anyone had any other methods of achieving this effect or any knowledge as to why this script would not be handling positioned DIV's nicely?

Thanks in advance for any assistance or pointers on this mater.
Richard.

Here is a link to the page using this script: http://www.richardmassey.com.au
Just use one of the menu buttons to see the effect issue in IE (buttons do not point anywhere yet).
<script>
function handleClick(elemId,href){
$(elemId).fade(); 
  setTimeout("nav('"+href+"')",1500);
return false;
}
 
function nav(href){
 location.href=href;
}
</script>
 
<a href="test.html" onclick="return handleClick('main-wrapper',this.href);">

Open in new window

Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

"why this script would not be handling positioned DIV's nicely?"

If you float a DIV, it takes the DIV out of the page context, so they act independently of the rest of the page, but you can use clear:both; in CSS to fix this issue.  Perhaps IE is treating relative/absolute positioned DIVs the same way.    Here are some different ways to approach this problem, you will have to try them --

www.positioniseverything.net/easyclearing.html
www.css-zibaldone.com/the-css-switch-project/september-2006/float-test-with-display-inline-block/
archivist.incutio.com/viewlist/css-discuss/5106
Avatar of RichardMass

ASKER

Hi scrathcyboy.

Gave those a try, unfortunately with no luck. Your right about the "it takes the DIV out of the page context", that was something I had not considered. If I don't have any luck with this problem, I think I will try to change the layout to suit the error (never a good option but we do what we have to).

Thank you for your attempt.
ASKER CERTIFIED SOLUTION
Avatar of scrathcyboy
scrathcyboy
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Still no luck I'm afraid. Implemented several of the hacks that appear at the site you linked to and still no luck. Can I confirm that you are able to see the bug when you view my test site: www.richardmassey.com.au

If you are certain the above link should have provided some benefit, could I ask you to please point out exactly what I should be doing as I simply wasn't able to get anywhere.

I thank you again for your time and quick responses. It is very much appreciated.

Richard.
OK... In the event anyone is looking for a solution to the same problem, simply setting the DIV that is to perform the fadein or fadeout with position:relative; did the trick. Now anything that is contained within the fading div will fade in/out as required.