Closed Thread Icon

Topic awaiting preservation: Need a link (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8816" title="Pages that link to Topic awaiting preservation: Need a link (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: Need a link <span class="small">(Page 1 of 1)</span>\

 
splodge
Nervous Wreck (II) Inmate

From: right about >x<there
Insane since: Aug 2003

posted posted 08-14-2003 20:02

Aight
where does a link go in this and whats the code so as it opens a new page when its completed its final swipe over.
cheers

<body scroll=no bgcolor=black>

<div id=sampleLayer style="position:absolute; top:2px; left:1px; width:1px; height:600px; border: 1px solid #FFFFFF; font-family:Verdana; font-size:8pt"></div>

<script language=JavaScript>
var posX, posY;
var ie = document.all?1:0;
var ns = document.layers?1:0;
var dom = document.getElementById?1:0;
var dhtml = new svetLayer("sampleLayer");
var path = new Array(1,3,5,3,12,3,22,3,33,3,44,3,55,3,66,5,77,3,88,3,99,3,120,3,150,3,200,3,257,3,300,3,350,3,377,3,400,3,422,3,434,3,452,3,476,3,497,3,515,3,536,3,554,3,569,3,587,3,602,3,614,3,6 29,3,641,3,644,3,656,3,668,3,686,3,686,3,686,3,686,3,683,3,683,3,671,3,671,3,668,3,662,3,656,3,650,3,647,3,647,3,638,3,635,3,629,3,623,3,620,3,617,3,611,3,605,3,599,3,590,3,587,3,5 81,3,578,3,569,3,566,3,560,3,551,3,548,3,545,3,539,3,530,3,527,3,524,3,518,3,515,3,509,3,500,3,485,3,479,3,479,3,479,3,476,3,467,3,467,3,455,3,452,3,452,3,449,53,440,3,437,3,434,3, 428,3,425,3,419,3,413,3,410,3,401,3,398,3,398,3,395,3,386,3,383,3,380,3,380,3,380,3,377,3,374,3,368,3,368,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3,365,3, 365,3,368,3,398,3,698,3,782,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3, 950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,950,3,955);
var index = 0;
var trNum = 0;
function svetLayer(id)
{
this.name = dom?document.getElementById(id):ie?document.all[id]:ns?document.layers[id]:null;
if (this.name !== null)
{
this.css = (dom&#0124; &#0124;ie)?this.name.style:this.name;
this.x = dom?this.css.pixelLeft:ie?parseInt(this.css.left):this.css.left;
this.y = dom?this.css.pixelTop:ie?parseInt(this.css.top):this.css.top;
this.moveTo = moveTo;
return this;
}
else alert('Your layer does not exist');
}

function moveTo(x,y)
{
if(dom&#0124; &#0124;ie)
{
this.x=x;
this.y=y;
this.css.left=x;
this.css.top=y;
}
else this.css.moveTo(x,y);
}
function timeline()
{
if(trNum < (path.length-1))
{
dhtml.moveTo(path[trNum],path[trNum+1])
trNum += 2;
setTimeout('timeline()',10);
}
else trNum=0;
}
window.onload=timeline;
</script>

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-15-2003 03:02

I think you're going to need to be waaaaaay more specific than that.

1. Let us know what your code does. (Very important - it's very difficult to figure out what code does just by looking at it.)

2. Let us know very specifically what you're trying to accomplish (and be careful to specify this unambiguously).

3. If you're dealing with an error or problem of some sort in the code (which I'm not sure you are), give us a link to an actual web page that displays the problem clearly.

We can probably help you with the opening a new page part, but it's very unclear what you mean by "where does a link go in this."

DL-44
Maniac (V) Inmate

From: under the bed
Insane since: Feb 2000

posted posted 08-15-2003 03:43



splodge
Nervous Wreck (II) Inmate

From: right about >x<there
Insane since: Aug 2003

posted posted 08-15-2003 03:51

Aight Slime

1. Let us know what your code does?
Its just a simple page effect that moves a layer in the form of a vertical line across the page from L to R with a slow and then fast action in the middle.

2. Let us know very specifically what you're trying to accomplish?
Once the layer has completed its movement and tracked over to the right hand side of the page where it will stop. I want it to open up a new page on completion of that movement.

3. Where does a link go?
I tried inserting a link at the end of the array

example

var path = new Array
(1,3,5,3,12,......................950,3,950,3,955)'a href=page2.htm');
But it didnt work, got an error
Hope that helps
cheers mate

splodge
Nervous Wreck (II) Inmate

From: right about >x<there
Insane since: Aug 2003

posted posted 08-19-2003 03:50

Aight Slime
Any news there bro on what the answer is to the above request?
cheers

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 08-19-2003 04:03

Well, first of all, you should know that this is a very inneficient way of doing this; it would be much better to dynamically calculate the object's position with a function than to store each animation frame's coordinate in an array.

The reason adding a URL to the end of the array didn't work is because that array can only contain coordinates for the element to move to. The functions that move the element don't know what to do with a URL.

To make a window open when the animation is finished, change the line

else trNum=0;

at the end of your script into

else {
trNum = 0;
window.open("URL HERE");
}

That bit of code is executed when the function has hit the end of the array, so that's where you want to tell it to open your window.

splodge
Nervous Wreck (II) Inmate

From: right about >x<there
Insane since: Aug 2003

posted posted 08-19-2003 13:50

Works great mate
Thank you for your time on this


« BackwardsOnwards »

Show Forum Drop Down Menu