دمو:
http://lesanarabi.rozblog.com/page/afket
اگه نظر ندی خیلی دلخور میشم
کد:
<script>
// CREDITS:
// Free JavaScript FlowerPower: put springtime on your website
// by Peter Gehrig
// Copyright (c) 2010 Peter Gehrig. All rights reserved.
// Permission given to use the script provided that this notice remains as is.
// Additional scripts can be found at .
// IMPORTANT:
// If you add this script to a script-library or a script-archive
// you have to insert a highly visible link to right into the
// webpage where the script will be displayed.
// number of blossoms
var numberofblossoms=20
// speed of blossom animation (higher means slower)
var openblossomspeed=100
// how long shall the blossom be visible after being opened? Answer in seconds
var showblossomstime=2
// do not edit the variables below
var frame=new Array()
frame[0]=new Image()
frame[0].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame1.gif"
frame[1]=new Image()
frame[1].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame2.gif"
frame[2]=new Image()
frame[2].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame3.gif"
frame[3]=new Image()
frame[3].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame4.gif"
frame[4]=new Image()
frame[4].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame5.gif"
frame[5]=new Image()
frame[5].src="http://www.fabulant.com/downloadcenter/imgblossomani/frame6.gif"
var i_nownumberofframes=0
var i_maxnumberofframes=5
var i_numberofblossoms=0
var marginleft=0
var margintop=0
var marginbottom
var marginright
var timer
var thisblossom
showblossomstime=showblossomstime*1000
function positionblossoms() {
marginbottom=document.body.clientHeight-40
marginright=document.body.clientWidth-40
for (i=0;i<=numberofblossoms;i++) {
var randx=Math.floor(marginright*Math.random())
var randy=Math.floor(marginbottom*Math.random())
thisblossom=eval("document.getElementById('blossom"+i+"').style")
thisblossom.left=randx
thisblossom.top=randy
thisblossom.visibility="visible"
}
thisblossom=eval("blossom0")
openblossoms()
}
function openblossoms() {
clearTimeout(timer)
if (i_nownumberofframes<=i_maxnumberofframes) {
thisblossom.innerHTML="<img src='"+frame[i_nownumberofframes].src+"'>"
i_nownumberofframes++
timer=setTimeout("openblossoms()",openblossomspeed)
}
else {
clearTimeout(timer)
i_nownumberofframes=0
switchtonextblossom()
}
}
function switchtonextblossom() {
i_numberofblossoms++
if (i_numberofblossoms<=numberofblossoms) {
thisblossom=eval("blossom"+i_numberofblossoms)
openblossoms()
}
else {
setTimeout("hideblossoms()",showblossomstime)
}
}
function hideblossoms() {
for (i=0;i<=numberofblossoms;i++) {
thisblossom=eval("document.getElementById('blossom"+i+"').style")
thisblossom.visibility="hidden"
}
}
for (i=0;i<=numberofblossoms;i++) {
document.write("<div id='blossom"+i+"' style='position:absolute;top:0px;left:0px;visibility:hidden;'><img name='blossomimg"+i+"' src='http://www.fabulant.com/downloadcenter/imgblossomani/frame1.gif'></div>")
document.clear()
}
window.onresize=positionblossoms
window.onload=positionblossoms
</script>
