?
Solved

Fadeout page on click and render new page from link

Posted on 2008-10-25
5
Medium Priority
?
850 Views
Last Modified: 2013-11-11
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

0
Comment
Question by:RichardMass
[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
  • 3
  • 2
5 Comments
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22806172
"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
0
 
LVL 1

Author Comment

by:RichardMass
ID: 22806244
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.
0
 
LVL 44

Accepted Solution

by:
scrathcyboy earned 1500 total points
ID: 22806332
"try to change the layout to suit the error"
That's a pretty drastic move, if the page is rendering correctly.  Look at the hasLayout property -
http://www.satzansatz.de/cssd/onhavinglayout.html
0
 
LVL 1

Author Comment

by:RichardMass
ID: 22806567
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.
0
 
LVL 1

Author Comment

by:RichardMass
ID: 22827625
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.
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

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

So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Suggested Courses

771 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