PDA

View Full Version : Two Falling Objects Script???


Lolly
09-12-2000, 08:28 AM
I found the follwing code at a1javascripts:
<!--
/*This script found by A1JavaScripts (http://www.a1javascripts.com) in non-working condition and corrected, all credit to unknown author, please keep this message in place if using this script
*/
browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) | | ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ))

if (ns4) {
layerRef="document.layers";
styleRef="";
} else {
layerRef="document.all";
styleRef=".style";
}

function moveSaturn(which, start, finish, step, speed){
if (ie4 | | ns4){
if (start < finish){
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
start=start+step;
setTimeout("moveSaturn('"+which+"',"+start+","+finish+","+step+","+speed+")",speed);
}
}
}
//-->

</script>
==========================================================
part 2 - enter your image, size and alt tags
===============================================================

<!-- --><DIV id=saturn style="position: absolute; top: -100; left: 30%; z-index: 0"><IMG alt="dhtml" src="java-ace1.gif" border=0 width=88 height=31></div><!-- -->

===========================================================
part 3
============================================================
<!-- --><body onload="moveSaturn('saturn',-180,220,3,3)"><!-- -->
I have implemented it to show one dropping animated gif heart over the heart position of one person on a jpg photo. I want to drop a second heart over the second person in the photo, but I dont know how to do this..I am not a programmer ( I stopped with elemetary pascal :)). Help? Can anyone tell me how to alter the code to do this. It can't be too difficult. Thanks a lot it would make a really great romantic pic :))Thanks LLoyd

Ian
09-13-2000, 12:37 AM
Hi Lloyd,

Here it is below for you, the additions to the script are in bold for you. Good luck.

<script language=javascript>
<!--
/*This script found by A1JavaScripts (http://www.a1javascripts.com) in non-working condition and corrected, all credit to unknown author, please keep this message in place if using this script
*/
browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) | | ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )))
ie4 = ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 ))
ns4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 ))

if (ns4) {
layerRef="document.layers";
styleRef="";
} else {
layerRef="document.all";
styleRef=".style";
}

function moveSaturn(which, start, finish, step, speed){
if (ie4 | | ns4){
if (start < finish){
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
start=start+step;
setTimeout("moveSaturn('"+which+"',"+start+","+finish+","+step+","+speed+")",speed);
}
}
}
function moveSaturn1(which, start, finish, step, speed){
if (ie4 | | ns4){
if (start < finish){
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
eval(layerRef + '["' + which +'"]' + styleRef + '.top = start');
start=start+step;
setTimeout("moveSaturn1('"+which+"',"+start+","+finish+","+step+","+speed+")",speed);
}
}
}
//-->

</script>
=========================================
part 2
=========================================
<!-- --><DIV id=saturn style="position: absolute; top: 100; left: 50%; z-index: 0"><IMG alt="dhtml" src="java-ace1.gif" border=0></div><DIV id=saturn1 style="position: absolute; top: 100; left: 50%; z-index: 0"><IMG alt="dhtml" src="SECOND-IMAGE.gif" border=0></div><!-- -->
=========================================
part 3
=========================================
<!-- --><body onload="moveSaturn('saturn',-180,300,2,1);moveSaturn1('saturn1',-80,265,4,2)"><!-- -->


------------------
Ian

Web Development - BIG Resources Inc
Head Guide - 123Webmaster.com (http://www.123webmaster.com/)
ian@123webmaster.com
BIG Resources.com (http://www.bigresources.com)
ICQ: 25828668

[This message has been edited by Ian (edited 09-12-2000).]