Cool Browser Effect!

Written by @kerixa 21 August 2012

This is an effect on the Browser. It makes it come from up to down.See it!

Code Snippet:

                                                
                                                <!-- this script is provided by www.javascriptfreecode.com coded by: Kerixa Inc. -->
<!-- Start of Browser Shake JavaScript -->
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">

<script>
function drop(n) {
if(self.moveBy){
self.moveBy (0,-900);
for(i = n; i > 0; i--){
self.moveBy(0,3);
}
for(j = 8; j > 0; j--){
self.moveBy(0,j);
self.moveBy(j,0);
self.moveBy(0,-j);
self.moveBy(-j,0);
}
}

}
</script>
<SCRIPT language="JavaScript">

<!--

var TrackRed= 0x00;   //(RED)   Replace the values after '0x' with the
var TrackGreen= 0x00; //(GREEN) two-letter/number hexadecimal color codes
var TrackBlue= 0x00;  //(BLUE)  in the BODY tag (after bgcolor=).

function FadeTo(steps,red,green,blue) 
{
        for (var i = 0; i <= steps; i++) 
        {
                var endpart = i/steps;
                var startpart = 1 - endpart;
                document.bgColor = 
                Math.floor(TrackRed * startpart + red * endpart)*256*256 +
                Math.floor(TrackGreen * startpart + green * endpart)*256 +
                Math.floor(TrackBlue * startpart + blue * endpart);
        }
        TrackRed=red; TrackGreen=green; TrackBlue=blue;

}

//-->

</SCRIPT>

<STYLE TYPE="text/css">
<!--
A {text-decoration:none;}
A:hover {color:silver;}
//-->
</STYLE>

</head>
<body bgcolor="black" text="silver" link="silver"
vlink="silver" alink="silver" onload="drop(300); FadeTo(50,0xFF,0xFF,0xFF);">


<br />
</body>
</html>
<!-- End of Browser Shake JavaScript -->
<a target='_blank' href='www.javascriptfreecode.com' style='font-size: 8pt; text-decoration: none'>JavaScript Best Codes</a>                                                
                                            

Example:


About @kerixa

I am Krishna Eydat. I studied Software Engineering at University of Waterloo in Canada. I lead a few tech companies. I am passionate about the way we are connected. I would like to be part of something big or be the big deal!

K

Comments


Here you can leave us commments. Let us know what you think about this code tutorial!

0 / 300

TRENDING POST
1
2
3
4
5
VISITORS
Online Users: 12
Recent Members: Shahmeer, coolcoco7, SmitaPatil25, owoboycute, 092010
advertisement 2