falling images script
 

SimplytheBest
Scripts

ASP scripts
PERL scripts
PHP scripts
JavaScripts & Ajax
Snippets
Online scripts

Ajax, DHTML
& JavaScripts

Animation
Background
Bookmarks
Buttons
Calculators
Cookies
Data handling
E-mail
Enhancements
Forms
Image rotation
Menus
Messages
Miscellaneous
Music
Password protection
Redirection
Scrollers
Tables
Time & date
Windows

Publishers
Add script
Account login
Publisher list



 

Home > Scripts > DHTML scripts & JavaScripts > Animation > Falling images script

 

Falling images script

AUTHOR: Altan d.o.o.
TYPE: Freeware
BROWSERS:
IE 4+, IE 5+, IE 6+, NS 4+

With this script you can make images fall down and then disappear from your page.


EXAMPLE

You should see some musical notes gently falling down your screen. The images can be snow flakes, stars or anything you decide. 


1)
Insert this script anywhere inside the <BODY> section of your page.

then copy (CTRL-C) & paste (CTRL-V)

2) Define the number of images to render in this section of the script:

var no = 10;

3) Define the image name and its location in this section of the script:

document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><a href=\"http://inet.hr/\"><img src=\"images/dot.gif\" border=\"0\"></a></layer>");
} else {
document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"images/dot.gif\" 

document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://inet.hr/\"><img src=\"images/dot.gif\" border=\"0\"></a></div>");
} else {
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src=\"images/dot.gif\" border=\"0\"></div>");

And here:

document.layers["dot"+i].top = yp[i];
document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]);

It may be easier to leave the image name to dot.gif and upload your own GIF using the name dot.gif and placing that in a subdirectory of where the script is called /images.

For examples of this script, you can also visit Altan's web site.


[BACK] [TOP]

 


Copyright © 1997-2009 SimplytheBest Inc. Terms of Use and Legal Disclaimer.
All copyrights are acknowledged. All rights reserved.