تبلیغات
مرکز کدهای جاوا و اچ تی ام ال - کد انفجار منور

کد انفجار منور

دوشنبه 5 مهر 1389 01:46 ق.ظ   نویسنده : محمد      


مرتبط با کدهای کاربردی
این کد جاوا اسکریپت چیزی شبیه انفجار منور رو در وبلاگتون نمایش میده




<!-- www.js.coo.ir -->
<!-- begin the script--><script LANGUAGE="JavaScript1.2">
//set Interval between each firework display,
var intervals=2000
var sparksOn     = true;
var speed        = 25;
var power        = 1;
//Dont change these values-------
var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var sparksAflyin = false;
var allDivs      = new Array(10);
var totalSparks  = 0;
//-------------------------------
function initAll(){
    if(!ns && !ie){
    sparksOn = false;
    return;
    }
setInterval("firework()",intervals)
if (ns)
    document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
    for(dNum=0; dNum<7; ++dNum){
        if(ie)
            allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
        else
            allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
    }}
function firework(){
//below code detects the browser dimenions
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}else if (ns){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset
}//below code randomly generates a set of coordinates that fall within the dimension
randomx=leftcorner+Math.floor(Math.random()*documentWidth)
randomy=topcorner+Math.floor(Math.random()*documentHeight)
    if(sparksOn){
        if(!sparksAflyin){
            sparksAflyin=true;
            totalSparks=0;
            for(var spark=0;spark<=6;spark++){
                dx=Math.round(Math.random()*50);
                dy=Math.round(Math.random()*50);
                moveTo(spark,randomx,randomy,dx,dy);
            }}}}
function moveTo(i,tempx,tempy,dx,dy){
    if(ie){        if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))
            tempy=document.body.offsetHeight+document.body.scrollTop-80;
        if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))
            tempx=document.body.offsetWidth+document.body.scrollLeft-80;
    }if(tempx>-50&&tempy>-50){
        tempx+=dx;tempy+=dy;    
        allDivs[i].left=tempx;
        allDivs[i].top=tempy;
        dx-=power;dy-=power;
        setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+"<img border="0" src="Http://mihanblog.com/Yahoo/3.Gif">",speed)
    }    else
        ++totalSparks
    if(totalSparks==7){
        sparksAflyin=false;
        totalSparks=0;
    }
}
window.onload=initAll
//End-->
</script>
<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:Aqua;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:22px; color:red;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:20px; color:blue;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:orange;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:yellow;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:25px; color:lightgreen;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:20px; color:silver;}
</style>
<p></p><div id="sDiv0">  *</div><div id="sDiv1">  *</div><div id="sDiv2">  *</div><div id="sDiv3">  *</div><div id="sDiv4">  *</div><div id="sDiv5">  *</div><div id="sDiv6">  *</div>

<!--end of the script-->
<!-- www.js.coo.ir -->



آخرین ویرایش: دوشنبه 12 مهر 1389 09:59 ب.ظ
دیدگاه ها ()
شنبه 18 شهریور 1396 06:06 ق.ظ
Hi there, I found your blog by means of Google even as searching for a related matter, your site came up, it appears to be like
good. I've bookmarked it in my google bookmarks.
Hi there, simply turned into alert to your blog through
Google, and located that it's really informative. I am going to be careful
for brussels. I'll be grateful when you continue this in future.

Numerous other folks will likely be benefited out of your writing.
Cheers!
شنبه 31 تیر 1396 01:45 ب.ظ
At this time it sounds like Movable Type is the preferred blogging
platform out there right now. (from what I've
read) Is that what you're using on your blog?
جمعه 2 تیر 1396 03:58 ق.ظ
First of all I want to say wonderful blog! I had a
quick question in which I'd like to ask if you do not mind.
I was curious to know how you center yourself and clear your head before writing.

I have had difficulty clearing my mind in getting my ideas out there.

I truly do enjoy writing but it just seems like the first
10 to 15 minutes are generally lost just trying to
figure out how to begin. Any recommendations or tips?

Kudos!
پنجشنبه 28 اردیبهشت 1396 11:18 ق.ظ
Just wish to say your article is as astounding. The clearness on your publish is simply great and
that i can suppose you're knowledgeable on this subject.

Well along with your permission let me to take hold of your feed to keep up to
date with imminent post. Thanks a million and please carry
on the rewarding work.
سه شنبه 22 فروردین 1396 03:45 ب.ظ
I'm truly enjoying the design and layout of your blog. It's a very easy on the
eyes which makes it much more pleasant for me to come here and visit more often. Did you hire out a designer to create your theme?
Fantastic work!
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر

درباره وبلاگ


نویسندگان

  • محمد (64)