Webmaster Forums 101 - Free Help and Discussions
 
 
 

MEMBER REWARDS - Earn free advertising by participating in these forums! Click here for details.

Welcome to Webmaster Forums 101!

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

Reply
 
Thread Tools Search this Thread Display Modes
Old 26th May 2003, 02:59 PM   #1

Username: Anonymous
Rank: WF101 Newbie
Join Date: Jan 2003
Posts: 25
Points: 0.00
Default This is new code that I learned... If anyone wants to use it

<p align=center><script language="JavaScript1.2" type="text/javascript">
<!--
/************************************************** ************************************************** *********************
************************************************** ******************************/


var ver = navigator.appVersion;
var dom = document.getElementById ? 1 : 0;
var ie5 = (ver.indexOf("MSIE 5") > -1 && dom) ? 1 : 0;
var n = (document.layers);
var ie = (document.all);

var sparksAflyin = 0;
var totalSparks = 0;
var sparksOn = 1;
function initMouseEvents() {
document.onmousedown = mouseDown;
if (n) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
}

function mouseDown(e) {
if (sparksOn) {
var mousex = (n) ? e.pageX : event.x+document.body.scrollLeft;
var mousey = (n) ? e.pageY : event.y+document.body.scrollTop;
if (!sparksAflyin) {
for (var k = 0; k <= 9; k++)
eval('SHOW("sDiv'+k+'")');
sparksAflyin = 1;
totalSparks = 0;
for(i = 0;i <= 9; i++)
eval('moveTo('+i+',0,'+mousex+','+mousey+')');
}
}
}

function moveTo(i,j, mousex, mousey) {
if (j < eval('anim_'+i+'_x.length') ) {
var tempx = eval('anim_'+i+'_x[j]+mousex');
var tempy = eval('anim_'+i+'_y[j]+mousey');
if (ie) {
if (tempy+30 > (document.body.offsetHeight+document.body.scrollTo p))
tempy = document.body.offsetHeight+document.body.scrollTop -30;
if (tempx+30 > (document.body.offsetWidth+document.body.scrollLef t))
tempx = document.body.offsetWidth+document.body.scrollLeft -30;
eval('document.all.sDiv'+i+'.style.left = tempx;');
eval('document.all.sDiv'+i+'.style.top = tempy;');
}
if (n) {
eval('document.layers.sDiv'+i+'.left = tempx;');
eval('document.layers.sDiv'+i+'.top = tempy;');
}
j++;
// timeout: 50 = fireworks speed, larger number = slower speed
setTimeout("moveTo("+i+","+j+","+mousex+","+mousey +")",50)
} else {
eval('HIDE("sDiv'+i+'")');
totalSparks++;
}

if (totalSparks == 10) {
sparksAflyin = 0;
totalSparks = 0;
}
}

function SHOW(divName) {
if (document.all)
eval('document.all.'+divName+'.style.visibility = "visible";');
else if (document.layers)
eval('document.layers["'+divName+'"].visibility = "visible";');
}

function HIDE(divName) {
if (document.all)
eval('document.all.'+divName+'.style.visibility = "hidden";');
else if (document.layers)
eval('document.layers["'+divName+'"].visibility = "hide";');
}

anim_0_x=new Array(20,20,10,0,0,0,0,0,0,0,0,0);
anim_0_y=new Array(-20,-40,-60,-80,-60,-40,-20,0,20,40,60,80);
anim_1_x=new Array(20,20,17,36,60,78,90,92,93,98,108,120,133,15 2,181);
anim_1_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
anim_2_x=new Array(20,20,2,3,4,5,6,7,8,9,10,12,13,15,18);
anim_2_y=new Array(-20,-20,-33,-38,-38,-27,-2,25,51,84,113,141,162,212,253);
anim_3_x=new Array(-20,-20,-2,-1,7,10,18,35,60,102,94,94,93,97,108,111,117,127);
anim_3_y=new Array(-20,-25,-64,-89,-104,-150,-173,-197,-213,-199,-151,-101,-66,-17,27,87,140,189);
anim_4_x=new Array(-20,-20,-10,-39,-30,-69,-64,-138,-154,-200,-181,-209,-191,-207,-203,-213,-202,-221,-211);
anim_4_y=new Array(-20,-20,-28,-51,-79,-100,-135,-154,-193,-183,-149,-134,-89,-60,8,51,107,157,201);
anim_5_x=new Array(-20,-29,-51,-72,-105,-133,-164,-189,-209,-229,-247,-270,-279,-282,-283,-283,-285,-286,-288);
anim_5_y=new Array(-20,-55,-86,-116,-154,-183,-205,-217,-217,-198,-169,-120,-44,-8,40,87,144,190,248);
anim_6_x=new Array(-20,-20,-7,14,44,79,143,186,217,226,234,244,250,259,265,274 );
anim_6_y=new Array(-20,-21,-72,-113,-139,-166,-188,-181,-126,-68,-3,54,134,187,215,257);
anim_7_x=new Array(20,20,-3,-9,-13,-27,-33,-44,-54,-66,-77,-95,-107,-136,-150,-160,-164,-168,-171,-172,-172,-176,-175);
anim_7_y=new Array(-20,-26,-43,-63,-89,-116,-145,-169,-201,-222,-240,-253,-254,-245,-220,-195,-160,-124,-81,-53,-26,19,68);
anim_8_x=new Array(-20,20,-35,39,0,45,-1,24,-15,14,-20,35,-18,38,-11,16,49,64,81,93,100,103,109);
anim_8_y=new Array(-20,-20,-32,-42,-62,-76,-89,-107,-132,-147,-173,-180,-192,-209,-236,-193,-119,-73,-24,51,95,130,188);
anim_9_x=new Array(-20,-51,-89,-110,-165,-191,-228,-240,-259,-271,-277,-281,-287);
anim_9_y=new Array(-20,-20,-35,-37,-34,-16,10,47,105,150,189,227,273);
//-->
</script>
</head>

<body leftmargin="10" marginwidth="10" topmargin="10" marginheight="10" link="#A0A0A0" alink="#A0A0A0" vlink="#A0A0A0" onLoad="initMouseEvents()" bgcolor="#000000">

<div id="sparks">
<div id="sDiv0" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
<div id="sDiv1" style="position:absolute; visibility: hidden;"><font face="windings" color="#ffffff">*</font></div>
<div id="sDiv2" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
<div id="sDiv3" style="position:absolute; visibility: hidden;"><font face="windings" color="#ffffff">*</font></div>
<div id="sDiv4" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
<div id="sDiv5" style="position:absolute; visibility: hidden;"><font face="windings" color="#ffffff">*</font></div>
<div id="sDiv6" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
<div id="sDiv7" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
<div id="sDiv8" style="position:absolute; visibility: hidden;"><font face="windings" color="#ffffff">*</font></div>
<div id="sDiv9" style="position:absolute; visibility: hidden;"><font face="windings" color="#99ccff">*</font></div>
</div>


</body></html>
<!--webbot bot="HTMLMarkup" endspan -->&</p>

</body>

</html>


-- Now, that should work... tell me if it doesn't...

The effect of this script is:

On Mouse click, stars fall from the tip of the cursor!!!

I hope you like the code...!!!--
Anonymous is offline   Reply With Quote
Old 27th May 2003, 11:20 AM   #2

Username: Jellybean
Rank: WF101 Newbie
Join Date: Mar 2003
Location: Noo Jerzy, USA
Posts: 11
Points: 0.00
Send a message via AIM to Jellybean Send a message via MSN to Jellybean Send a message via Yahoo to Jellybean
Default

Pretty cool! It would get a little annoying after a while, but still a cool effect! Good job!
__________________
Jellybean is offline   Reply With Quote
Old 27th May 2003, 11:21 AM   #3

Username: Jellybean
Rank: WF101 Newbie
Join Date: Mar 2003
Location: Noo Jerzy, USA
Posts: 11
Points: 0.00
Send a message via AIM to Jellybean Send a message via MSN to Jellybean Send a message via Yahoo to Jellybean
Default

By the way, if you wanna see what it looks like...

http://jakejarvis.com/fireworks.php
__________________
Jellybean is offline   Reply With Quote
Old 27th May 2003, 12:58 PM   #4
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

Quote:
Originally Posted by Jellybean
By the way, if you wanna see what it looks like...

http://jakejarvis.com/fireworks.php

Moved to Programmy/Coding

They are stars? :cheesygr:

Nice script mikely!
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Old 28th May 2003, 08:41 AM   #5

Username: PY 222
Rank: WF101 Fanatic
Join Date: Jan 2003
Location: California
Posts: 189
Points: 0.00
Default

Very cool script.

Unfortunately I don't have any use for a script like that.
__________________
When the Bitterness is gone, Sweetness will follow.
PY 222 is offline   Reply With Quote
Old 3rd September 2003, 01:17 PM   #6

Username: f-w-r
Rank: WF101 Member
Join Date: Jul 2003
Location: Traverse City, MI, USA
Posts: 32
Points: 0.00
Default

The link went down. :?
__________________
-------------------------------
Free Webmaster Resources
http://www.f-w-r.com
-------------------------------
f-w-r is offline   Reply With Quote
Old 3rd September 2003, 03:15 PM   #7
Mr. Tech's Avatar

Username: Mr. Tech
Rank: Problem Solver
Join Date: Dec 2004
Location: Gold Coast, Australia
Posts: 2,166
Points: 1,025.61
Send a message via MSN to Mr. Tech
Default

JellyBean, you redesigning your site again? :cheesygr:
__________________
Please read the Forum Rules

Get rewarded for posting
- free advertising!

.::. [ Webmaster Resources ] .::. [ Web Design ] .::. [ Developer Tutorials ] .::.
Mr. Tech is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Showing Code Mr Dooby Website Design & Coding 3 17th March 2005 03:48 PM
HELP ME WITH A JAVA CODE I CANT SEEM TO FIND OR GET HELP ON USMCFR Website Design & Coding 2 26th November 2003 08:33 AM

Login
User Name
Password


Featured Members


Featured Links


Useful Resources
Webmaster Resources
Developers Tools
Developer Tutorials


Partners

All times are GMT +10. The time now is 05:55 AM.


Powered by vBulletin Version 3.5.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.3.2
 
 
WEBMASTER FORUMS 101
ARCHIVE
CONTACT US
TOP
   
© Webmaster Forums 101 2005. All Rights Reserved.
Design by: vBCore