...

View Full Version : fade in page onload



chris_angell
08-19-2002, 02:52 PM
hello, I am trying to get the page to fade in when it loads.. instead of using the microsoft enterpage metahead value..

here is the code I am trying, but no luck

<html>

<head>
<SCRIPT LANGUAGE="JavaScript">
function fadeInPage() {
if (document.getElementById("fadeDiv").filters.alpha.opacity < 100){
document.getElementById("fadeDiv").filters.alpha.opacity += 10;
eval('setTimeout("fadeInPage()",100)');
}
else{
document.getElementById('fadeDiv').style.visibility = "visable"
}
}
</script>
</head>

<body onLoad="fadeinpage()">

<DIV ID="fadeDiv" style="visibility:hidden">
your page code goes here
</DIV>
</body>

</html>

requestcode
08-19-2002, 04:24 PM
Check out this link to a wizard at Dynamic Drive:
http://www.dynamicdrive.com/dynamicindex3/document2.htm

I believe you want the blendin, but there are several other effects also. Good Luck.

requestcode
08-19-2002, 04:28 PM
OOPS that uses the META tag, which is what you don't want. Here is one from JavaScriptkit's Free Script section:
http://www.wsabstract.com/script/cut4.shtml

premshree
08-19-2002, 04:28 PM
Here's the code :



<html>
<head>
<SCRIPT LANGUAGE="JavaScript">
function fadeInPage()
{
if(document.getElementById("fadeDiv").filters("alpha").opacity < 100)
{
document.getElementById("fadeDiv").filters("alpha").opacity += 10;
setTimeout("fadeInPage()",100);
}
else
{
document.getElementById('fadeDiv').style.visibility = "visible";
}
}
</script>
</head>

<body onLoad="fadeInPage()">

<DIV ID="fadeDiv" style="filter:Alpha(opacity=0); width:100%">
Welcome to my Homepage!
</DIV>

</body>
</html>


:thumbsup:

yaksho
03-01-2010, 05:40 PM
Just download the jquery.js from jquery library and pot the below code at head

<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){

$(document).ready(function () {
$('.nav').fadeIn(3000);
});

});
</script>

after that <div class="nav" style="display:none"> this is the DIV which will fade in while page loads..

Good LUck



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum