2
   

Trio mousetrail won't work whn added to HTML page

 
 
kita
 
Reply Tue 24 Feb, 2004 02:29 pm
I'm trying to add Trio mousetrail to an already existing page (& I swear blind I pasted it in correctly).

Works fine on a blank page but is invisible on HTML page. Page has no other layers on it (yup - sorry still using tables) so didn't think it could be z-index issue?

Also is there anyway I could modify it (dummies version) to only have two swirly things instead of 3?

Thanks again
k.
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Discussion • Score: 2 • Views: 3,687 • Replies: 29
No top replies

 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 02:43 pm
It's working for me on an html page.

Can you post your html code?

The easiest way to reduce it to two swirlies would simply be to change the color of one to the same color as the background of the page. It could be re-written for only two but if you can't do that you can at least change the color to make one barely visible.

But lets see if we can get it working for you, before considering modifications.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 02:55 pm
How would you like that code?
Apologies - a bit new to this...
Would you like the whole <script> part of the <head> including already existing preload images stuff etc. or just the stuff relating to TRIO?
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 02:58 pm
I have the script code, it sounds like there isstuff in the page that is problemactic so I'd need all the page's code.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 02:59 pm
Oops, forgot to add... background colour has both light and dark areas so changing 1 colour worked beautifully until applied to the actual page.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 02:59 pm
How would you like that code?
Apologies - a bit new to this...
Would you like the whole <script> part of the <head> including already existing preload images stuff etc. or just the stuff relating to TRIO?
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 03:00 pm
I was worried about that. But getting it working first is important before changing it.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 03:03 pm
and the code is...
Damn you're brave!


Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>AFRICAN COLOUR SYSTEMS Home Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.bgimage {
background-image: url(images/pages/pg1bkgnd.gif);
background-repeat: no-repeat;
background-position: left top;
}
.bodycopy {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-style: normal;
line-height: 120%;
font-weight: bold;
color: #000000;
}
-->
</style>


<script language="JavaScript" type="text/JavaScript">
<!--

function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->


<!--
/*
Trio Script by Kurt Grigg - http://www.btinternet.com/~kurt.grigg/javascript
Script featured on Able2Know.com
Find free scripts & get free help: http://search.able2know.com/web_development/scripts/
*/

//Choose colours and size of effect !!
a_Colour='#666666';
b_Colour='#ff0000';
c_Colour='#ffffff';
size=50;
n=7;

//Alter nothing below !!
var n6=(navigator.appName == "Netscape" && parseFloat(navigator.appVersion) >= 5)?true:false;
var n4=(document.layers);
var o6=(navigator.appName.indexOf("Opera") != -1)?true:false;
var ie=(document.all);
if (n6&&n > 4) n=4;//N6 struggles over 4?
dy=new Array();
dx=new Array();
cstep=0;
step=0.2;
xpos=0;
ypos=0;
if (n4){
for (i = 0; i < n; i++){
document.write('<layer name=x'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+a_Colour+'></layer>');
document.write('<layer name=y'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+b_Colour+'></layer>');
document.write('<layer name=z'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+c_Colour+'></layer>');
}
}
else{
if (ie)
document.write('<div id="con" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < n; i++){
document.write('<div id=x'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+a_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=y'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+b_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=z'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+c_Colour+';font-size:'+i/2+'"></div>');
}
if (ie) document.write('</div></div>');
}
if (n4||n6){
window.captureEvents(Event.MOUSEMOVE);
function mouse1(ev){
ypos = ev.pageY+16-window.pageYOffset;
xpos = ev.pageX+6;
}
if (n4) window.onMouseMove=mouse1;
else document.onmousemove=mouse1;
}
if (ie||o6){
function mouse2(){
ypos = (ie)?event.clientY+16:event.clientY+16-window.pageYOffset;
xpos = event.clientX+6;
}
document.onmousemove=mouse2;
}
function leaders(){
e=360/3;
for (i = 0; i < 3; i++){
dy[i]=ypos+size*Math.cos(cstep+i*e*Math.PI/180)*Math.sin((cstep+i*25)/2);
dx[i]=xpos+size*Math.sin(cstep+i*e*Math.PI/180)*Math.sin((cstep+i*25)/2)*Math.sin(cstep/4);
}
cstep+=step;
setTimeout('leaders()',10);
}

function assign(){
f=(ie)?0:window.pageYOffset;
if (ie) con.style.top=document.body.scrollTop;
for (i=0; i < n; i++){

var temp1 = (n4)?document.layers["x"+i]:document.getElementById("x"+i).style;
var temp2 = (n4)?document.layers["y"+i]:document.getElementById("y"+i).style;
var temp3 = (n4)?document.layers["z"+i]:document.getElementById("z"+i).style;

if (i < n-1){
var temp4 = (n4)?document.layers["x"+(i+1)]:document.getElementById("x"+(i+1)).style;
var temp5 = (n4)?document.layers["y"+(i+1)]:document.getElementById("y"+(i+1)).style;
var temp6 = (n4)?document.layers["z"+(i+1)]:document.getElementById("z"+(i+1)).style;
temp1.top = parseInt(temp4.top);
temp1.left = parseInt(temp4.left);
temp2.top = parseInt(temp5.top);
temp2.left = parseInt(temp5.left);
temp3.top = parseInt(temp6.top);
temp3.left = parseInt(temp6.left);
}
else{
temp1.top=dy[0]+f;temp1.left=dx[0];
temp2.top=dy[1]+f;temp2.left=dx[1];
temp3.top=dy[2]+f;temp3.left=dx[2];
}
}
setTimeout("assign()",10);
}
function Start(){
leaders();
assign();
}
window.onload=Start;
// -->
</script>
</head>

<body bgcolor="#999999" text="#000000" link="#000000" vlink="#666666" alink="#999999" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="bgimage" onLoad="MM_preloadImages('images/nav2/navbar3a_r1_c2_f3.jpg','images/nav2/navbar3a_r1_c2_f2.jpg','images/nav2/navbar3a_r1_c3_f3.jpg','images/nav2/navbar3a_r1_c3_f2.jpg','images/nav2/navbar3a_r1_c5_f3.jpg','images/nav2/navbar3a_r1_c5_f2.jpg','images/nav2/navbar3a_r1_c6_f3.jpg','images/nav2/navbar3a_r1_c6_f2.jpg','images/nav2/navbar3a_r1_c8_f2.jpg')">
<table width="100%" height="60" border="0" cellpadding="0" cellspacing="0" id="nav">
<tr>
<td height="60" bgcolor="#000000"> <table width="649" height="41" border="0" align="left" cellpadding="0" cellspacing="0" id="navbar">
<!-- fwtable fwsrc="navbar3a.png" fwbase="navbar3a.jpg" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<tr>
<td width="99" height="1"><img src="images/nav2/spacer.gif" width="99" height="1" border="0" alt=""></td>
<td width="60"><img src="images/nav2/spacer.gif" width="60" height="1" border="0" alt=""></td>
<td width="119"><img src="images/nav2/spacer.gif" width="119" height="1" border="0" alt=""></td>
<td width="54"><img src="images/nav2/spacer.gif" width="54" height="1" border="0" alt=""></td>
<td width="120"><img src="images/nav2/spacer.gif" width="120" height="1" border="0" alt=""></td>
<td width="86"><img src="images/nav2/spacer.gif" width="86" height="1" border="0" alt=""></td>
<td width="6"><img src="images/nav2/spacer.gif" width="6" height="1" border="0" alt=""></td>
<td width="101"><img src="images/nav2/spacer.gif" width="101" height="1" border="0" alt=""></td>
<td width="4"><img src="images/nav2/spacer.gif" width="4" height="1" border="0" alt=""></td>
</tr>
<tr>
<td height="40"><img name="navbar3a_r1_c1" src="images/nav2/navbar3a_r1_c1.jpg" width="99" height="40" border="0" alt="Products Menu"></td>
<td><a href="ezi.html" target="_top" onClick="MM_nbGroup('down','navbar1','navbar3a_r1_c2','images/nav2/navbar3a_r1_c2_f3.jpg',1);" onMouseOver="MM_nbGroup('over','navbar3a_r1_c2','images/nav2/navbar3a_r1_c2_f2.jpg','images/nav2/navbar3a_r1_c2_f3.jpg',1);" onMouseOut="MM_nbGroup('out');"><img name="navbar3a_r1_c2" src="images/nav2/navbar3a_r1_c2.jpg" width="60" height="40" border="0" alt=""></a></td>
<td><a href="sdc_frameset.html" target="_top" onClick="MM_nbGroup('down','navbar1','navbar3a_r1_c3','images/nav2/navbar3a_r1_c3_f3.jpg',1);" onMouseOver="MM_nbGroup('over','navbar3a_r1_c3','images/nav2/navbar3a_r1_c3_f2.jpg','images/nav2/navbar3a_r1_c3_f3.jpg',1);" onMouseOut="MM_nbGroup('out');"><img name="navbar3a_r1_c3" src="images/nav2/navbar3a_r1_c3.jpg" width="119" height="40" border="0" alt=""></a></td>
<td><img name="navbar3a_r1_c4" src="images/nav2/navbar3a_r1_c4.jpg" width="54" height="40" border="0" alt="Links Menu"></td>
<td><a href="http://www.sdcenterprizes.co.uk" target="_blank" onClick="MM_nbGroup('down','navbar1','navbar3a_r1_c5','images/nav2/navbar3a_r1_c5_f3.jpg',1);" onMouseOver="MM_nbGroup('over','navbar3a_r1_c5','images/nav2/navbar3a_r1_c5_f2.jpg','images/nav2/navbar3a_r1_c5_f3.jpg',1);" onMouseOut="MM_nbGroup('out');"><img name="navbar3a_r1_c5" src="images/nav2/navbar3a_r1_c5.jpg" width="120" height="40" border="0" alt="Visite the SDC Enterprises web site"></a></td>
<td><a href="http://www.datacolor.com" target="_blank" onClick="MM_nbGroup('down','navbar1','navbar3a_r1_c6','images/nav2/navbar3a_r1_c6_f3.jpg',1);" onMouseOver="MM_nbGroup('over','navbar3a_r1_c6','images/nav2/navbar3a_r1_c6_f2.jpg','images/nav2/navbar3a_r1_c6_f3.jpg',1);" onMouseOut="MM_nbGroup('out');"><img name="navbar3a_r1_c6" src="images/nav2/navbar3a_r1_c6.jpg" width="86" height="40" border="0" alt="Visite the Datacolor web site"></a></td>
<td><img name="navbar3a_r1_c7" src="images/nav2/navbar3a_r1_c7.jpg" width="6" height="40" border="0" alt=""></td>
<td><a href="mailto:[email protected]" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('navbar3a_r1_c8','','images/nav2/navbar3a_r1_c8_f2.jpg',1);"><img name="navbar3a_r1_c8" src="images/nav2/navbar3a_r1_c8.jpg" width="101" height="40" border="0" alt="Email African Colour Systems"></a></td>
<td><img name="navbar3a_r1_c9" src="images/nav2/navbar3a_r1_c9.jpg" width="4" height="40" border="0" alt=""></td>
</tr>
</table></td>
</tr>
</table>
<table width="584" height="249" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="134" height="233" align="center" valign="bottom"><img src="images/spacer.gif" width="134" height="210"></td>
<td width="419" align="left" valign="bottom" class="logo"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" name="acs" width="384" height="186" id="acs">
<param name="movie" value="acs_anim.swf">
<param name="quality" value="high"><param name="LOOP" value="false">
<embed src="acs_anim.swf" width="384" height="186" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="acs" swliveconnect="true"></embed></object></td>
</tr>
</table>
<table width="647" height="100" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="100" align="left" valign="top" nowrap> <div align="center"><span class="bodycopy"><img src="images/spacer.gif" width="640" height="8"><br>
Suite 1, Village Square, 19a Village Road, Kloof, Kwazulu-Natal, 3610<br>
P.O. Box 22, Kloof, Kwazulu-Natal, 3640, Republic of South Africa<br>
Tel +27 - (031) - 7644516 Fax +27 - (031) - 7644835<br>
<a href="mailto:[email protected]">e-mail : [email protected]</a></span></div>

</td>
</tr>
</table>
</body>
</html>
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 03:08 pm
Well, I see two things wrong.

1) Two scripts are combined. I do not know if this makes a difference because I didn't look at your scipt.

2) There are at least two onload calls. They are conflicting with each other.

I'll be back in a few with a fix.
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 03:14 pm
Here is the general idea:

You need to write a function that combines functions, here is one that might also solve your background issue:

Code:<script type='text/javascript'>
<!--
if ((document.getElementById || document.all) && document.images) {
window.onload = specialOnload;
}
function specialOnload()
{
specialFunction1();
specialFunction2();
preloadImages('...', '...');
}
// -->
</script>


In this script, the onload can trigger as many functions as you want. So in your page where you have a preload function in the onload body tag you would move that function up into this script, you'd also move the onload call from the trio script into this script and any other functions that require an onload.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 03:45 pm
Thank you.

But I don't really understand how to apply it. What would I put where and how do I tie my existing code into it.

Apologies if this is exasperating. Just underlines the fact that I need to learn JavaScript and stop relying on Dreamweaver to write it for me ESPECIALLY if I don't understand what it's doing and where it may clash.
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 03:52 pm
Ok put this in your header:

Code:<script type='text/javascript'>
<!--
function specialOnload()
{
Start();
MM_preloadImages('images/nav2/navbar3a_r1_c2_f3.jpg','images/nav2/navbar3a_r1_c2_f2.jpg','images/nav2/navbar3a_r1_c3_f3.jpg','images/nav2/navbar3a_r1_c3_f2.jpg','images/nav2/navbar3a_r1_c5_f3.jpg','images/nav2/navbar3a_r1_c5_f2.jpg','images/nav2/navbar3a_r1_c6_f3.jpg','images/nav2/navbar3a_r1_c6_f2.jpg','images/nav2/navbar3a_r1_c8_f2.jpg');
}
// -->
</script>


Replace your onload call in the body tag with this one:

Code:onLoad="specialOnload();"


Then remove the following line from the trio script:

Code:window.onload=Start;


On your other thread I posted code to solve the flash loading problem. With the code above all your questions should be solved.

Lemme know how it goes.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 04:15 pm
Aaaah, riiiiiight. And the TV flickers.

Now, the header script, does it go into the head above all the other stuff that is required for the scripts?

Is it kosher to have multiple <script></script> tags in the header or is it better to contain all the stuff between 1 set of tags? I'm starting to see the appeal of an external .js file Smile
0 Replies
 
Craven de Kere
 
  1  
Reply Tue 24 Feb, 2004 04:26 pm
kita wrote:

Now, the header script, does it go into the head above all the other stuff that is required for the scripts?


It shouldn't matter because nothing will be done till all the page is loaded. But I'd put it after the other scripts because it references them.

Quote:
Is it kosher to have multiple <script></script> tags in the header or is it better to contain all the stuff between 1 set of tags? I'm starting to see the appeal of an external .js file Smile


It's fine to have multiple script tags, the only consideration is that it's a wee bit more text.

Moving them to external files is where real change can be seen because the scripts will then be cached for use across multiple pages, this will speed up your pageloading for repeat visitors whose browsers cache the external js.
0 Replies
 
kita
 
  1  
Reply Tue 24 Feb, 2004 04:53 pm
thanks
Thank you for all your help. It's 1am where I am so figure I'll give it a bash tomorrow with a clear head.

The Flash solution looks good!

Will let you know ...
0 Replies
 
kita
 
  1  
Reply Wed 25 Feb, 2004 03:00 am
still no mousetrail... heeelp
O.K. I "repaired" script tags so that everything is back into it's own tags with the new special function bit.
But I still get no mousetrail.

Also when I enter site from its index page then I get no background img on indexflash page. But if I navigate back to it from another page or refresh the page it comes up. Come to think of it I don't think it's been included in the preload images script (?)

Please, please could you take a look and tell me where, oh where, have I gone wrong?
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 25 Feb, 2004 11:50 am
Please don't post links. That's not allowed here.

I've rre-written all the JavaScript I'd written, I hadn't known that document.write would act that way when in a function.

Here is an example page with the following:

1) Flash that loads last.
2) Trio Mousetrail
3) Image preloading

All are functional and all you have to do is make sure teh paths in the Flash code are altered accordingly. I set them to full URLs so that I could test it.

Here ya go, all of them are tested and working.

Code:<html>
<head>
<script language="JavaScript">
<!--
/*
Trio Script by Kurt Grigg - http://www.btinternet.com/~kurt.grigg/javascript
Script featured on Able2Know.com
Find free scripts & get free help: http://search.able2know.com/web_development/scripts/
*/

//Choose colours and size of effect !!
a_Colour='#ff0000';
b_Colour='#ffffff';
c_Colour='#0000ff';
size=50;
n=7;

//Alter nothing below !!
var n6=(navigator.appName == "Netscape" && parseFloat(navigator.appVersion) >= 5)?true:false;
var n4=(document.layers);
var o6=(navigator.appName.indexOf("Opera") != -1)?true:false;
var ie=(document.all);
if (n6&&n > 4) n=4;//N6 struggles over 4?
dy=new Array();
dx=new Array();
cstep=0;
step=0.2;
xpos=0;
ypos=0;
if (n4){
for (i = 0; i < n; i++){
document.write('<layer name=x'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+a_Colour+'></layer>');
document.write('<layer name=y'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+b_Colour+'></layer>');
document.write('<layer name=z'+i+' top=0 left=0 width='+i/2+' height='+i/2+' bgcolor='+c_Colour+'></layer>');
}
}
else{
if (ie)
document.write('<div id="con" style="position:absolute;top:0px;left:0px"><div style="position:relative">');
for (i = 0; i < n; i++){
document.write('<div id=x'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+a_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=y'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+b_Colour+';font-size:'+i/2+'"></div>');
document.write('<div id=z'+i+' style="position:absolute;top:0px;left:0px;width:'+i/2+';height:'+i/2+';background:'+c_Colour+';font-size:'+i/2+'"></div>');
}
if (ie) document.write('</div></div>');
}
if (n4||n6){
window.captureEvents(Event.MOUSEMOVE);
function mouse1(ev){
ypos = ev.pageY+16-window.pageYOffset;
xpos = ev.pageX+6;
}
if (n4) window.onMouseMove=mouse1;
else document.onmousemove=mouse1;
}
if (ie||o6){
function mouse2(){
ypos = (ie)?event.clientY+16:event.clientY+16-window.pageYOffset;
xpos = event.clientX+6;
}
document.onmousemove=mouse2;
}
function leaders(){
e=360/3;
for (i = 0; i < 3; i++){
dy[i]=ypos+size*Math.cos(cstep+i*e*Math.PI/180)*Math.sin((cstep+i*25)/2);
dx[i]=xpos+size*Math.sin(cstep+i*e*Math.PI/180)*Math.sin((cstep+i*25)/2)*Math.sin(cstep/4);
}
cstep+=step;
setTimeout('leaders()',10);
}

function assign(){
f=(ie)?0:window.pageYOffset;
if (ie) con.style.top=document.body.scrollTop;
for (i=0; i < n; i++){

var temp1 = (n4)?document.layers["x"+i]:document.getElementById("x"+i).style;
var temp2 = (n4)?document.layers["y"+i]:document.getElementById("y"+i).style;
var temp3 = (n4)?document.layers["z"+i]:document.getElementById("z"+i).style;

if (i < n-1){
var temp4 = (n4)?document.layers["x"+(i+1)]:document.getElementById("x"+(i+1)).style;
var temp5 = (n4)?document.layers["y"+(i+1)]:document.getElementById("y"+(i+1)).style;
var temp6 = (n4)?document.layers["z"+(i+1)]:document.getElementById("z"+(i+1)).style;
temp1.top = parseInt(temp4.top);
temp1.left = parseInt(temp4.left);
temp2.top = parseInt(temp5.top);
temp2.left = parseInt(temp5.left);
temp3.top = parseInt(temp6.top);
temp3.left = parseInt(temp6.left);
}
else{
temp1.top=dy[0]+f;temp1.left=dx[0];
temp2.top=dy[1]+f;temp2.left=dx[1];
temp3.top=dy[2]+f;temp3.left=dx[2];
}
}
setTimeout("assign()",10);
}
function Start(){
leaders();
assign();
}
// -->
</script>
<script type='text/javascript'>
<!--
function specialOnload()
{
Start();
MM_preloadImages( 'images/pages/pg1bkgnd.gif','images/nav2/navbar3a_r1_c2_f3.jpg','images/nav2/navbar3a_r1_c2_f2.jpg','images/nav2/navbar3a_r1_c3_f3.jpg','images/nav2/navbar3a_r1_c3_f2.jpg','images/nav2/navbar3a_r1_c5_f3.jpg','images/nav2/navbar3a_r1_c5_f2.jpg','images/nav2/navbar3a_r1_c6_f3.jpg','images/nav2/navbar3a_r1_c6_f2.jpg','images/nav2/navbar3a_r1_c8_f2.jpg');
}
// -->
</script>
<style type="text/css">
<!--
.bgimage {
background-image: url(images/pages/pg1bkgnd.gif);
background-repeat: no-repeat;
background-position: left top;
}
.bodycopy {
font-family: Arial, Helvetica, sans-serif;
font-size: 15px;
font-style: normal;
line-height: 120%;
font-weight: bold;
color: #000000;
}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
if (event == "init" && args.length > 2) {
if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
nbArr[nbArr.length] = img;
for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = args[i+1];
nbArr[nbArr.length] = img;
} }
} else if (event == "over") {
document.MM_nbOver = nbArr = new Array();
for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])? args[i+1] : img.MM_up);
nbArr[nbArr.length] = img;
}
} else if (event == "out" ) {
for (i=0; i < document.MM_nbOver.length; i++) {
img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
} else if (event == "down") {
nbArr = document[grpName];
if (nbArr)
for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
document[grpName] = nbArr = new Array();
for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
if (!img.MM_up) img.MM_up = img.src;
img.src = img.MM_dn = (args[i+1])? args[i+1] : img.MM_up;
nbArr[nbArr.length] = img;
} }
}

function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onLoad="specialOnload();">
text
<script>
<!--
if ((document.getElementById || document.all) && document.images)
{
document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" name="acs" width="384" height="186" id="acs"><param name="movie" value="http://www.flamingjava.co.za/acs/acs_anim.swf"><param name="quality" value="high"><param name="LOOP" value="false"><embed src="http://www.flamingjava.co.za/acs/acs_anim.swf" width="384" height="186" loop="false" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="acs" swliveconnect="true"></embed></object>');
}
// -->
</script>
text
</body>
</html>
0 Replies
 
kita
 
  1  
Reply Wed 25 Feb, 2004 02:59 pm
Thanks so much for all your time and effort!
Will give it a bash. Any suggestions for books/resources on learning JavaScript? The "For Dummies" series perhaps? Very Happy
0 Replies
 
Craven de Kere
 
  1  
Reply Wed 25 Feb, 2004 03:03 pm
I don't know. I don't know JavaScript either. I just learn it on the fly when I need it.

So when I need something I just start coding and work it out through experimentation. I look up things in search engines but that's the only reference I've used.
0 Replies
 
kita
 
  1  
Reply Thu 26 Feb, 2004 11:44 am
I don't get it...
I'm sorry I still don't get the mousetrail. See your PM's for link.
0 Replies
 
 

Related Topics

Webdevelopment and hosting - Question by harisit2005
Showing an Ico File - Discussion by Brandon9000
how to earn money in internet - Discussion by rizwanaraj
The version 10 bug. Worse then Y2K! - Discussion by Nick Ashley
CSS Border style colors - Question by meesa
There is no Wisdom in Crowds - Discussion by ebrown p
THANK YOU CRAVEN AND NICK!!! - Discussion by dagmaraka
I'm the developer - Discussion by Nick Ashley
 
  1. Forums
  2. » Trio mousetrail won't work whn added to HTML page
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 05/10/2024 at 05:45:04