473,325 Members | 2,774 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Need help with javascript links

Hi, I've been using a javascript script to create a dragon that flies across the page. Anyways, I'd like to make it so when you click the dragon it takes you to a new page. Was wondering if anyone could help me out here.

Below is the complete script.
Expand|Select|Wrap|Line Numbers
  1. <SCRIPT language="JavaScript1.2">
  2.  
  3.  
  4. var cursorpath="http://i68.photobucket.com/albums/i9/worklog_halcyon/Misc/pet1_lohi_dog.png"
  5.  
  6.  
  7. if (document.layers)
  8. {document.write("<LAYER NAME='PoInTeRs' LEFT=10 TOP=10><img src='"+cursorpath+"' width=60 height=66></LAYER>")}
  9. else if (document.all){document.write("<div id='pOiNtErS' style='position:absolute;top:10px;left:10px;width:60px;height:66px;z-index:100'><img src='"+cursorpath+"' width=60 height=66></div>")}
  10.  
  11. count=-1;                                                     
  12. move=1;
  13.  
  14. function Curve(){
  15. abc=new Array(0,1,1,1,2,3,4,0,6,-1,-1,-1,-2,-3,-4,0,-6)
  16. for (i=0; i < abc.length; i++)
  17. {var C=Math.round(Math.random()*[i])}
  18. howbend=abc[C];
  19. setTimeout('Curve()',1900);
  20. return howbend;
  21. }
  22. ypos=10;
  23. xpos=10;
  24.  
  25. degree = 60;
  26. function MoveRandom(){
  27. PathBend=degree+=howbend;//ok!
  28. y = 4*Math.sin(PathBend*Math.PI/180);
  29. x = 6*Math.cos(PathBend*Math.PI/180);
  30. if (document.layers){
  31. ypos+=y;
  32. xpos+=x;
  33. document.PoInTeRs.top=ypos+window.pageYOffset;
  34. document.PoInTeRs.left=xpos+window.pageXOffset;
  35. }
  36. else if (document.all){
  37. ypos+=y;
  38. xpos+=x;
  39. document.all.pOiNtErS.style.top=ypos+document.body.scrollTop;
  40. document.all.pOiNtErS.style.left=xpos+document.body.scrollLeft;
  41. }
  42. T=setTimeout('MoveRandom()',50);
  43. }
  44. function edges(){
  45. if (document.layers){
  46. if (document.PoInTeRs.left >= window.innerWidth-40+window.pageXOffset)degree=Math.round(Math.random()*45+157.5);
  47. if (document.PoInTeRs.top >= window.innerHeight-30+window.pageYOffset)degree=Math.round(Math.random()*45-112.5);
  48. if (document.PoInTeRs.top <= 2+window.pageYOffset) degree = Math.round(Math.random()*45+67.5);//OK!
  49. if (document.PoInTeRs.left <= 2+window.pageXOffset) degree = Math.round(Math.random()*45-22.5);//OK!
  50. }
  51. else if (document.all)
  52. {
  53. if (document.all.pOiNtErS.style.pixelLeft >= document.body.offsetWidth-45+document.body.scrollLeft)degree=Math.round(Math.random()*45+157.5);
  54. if (document.all.pOiNtErS.style.pixelTop >= document.body.offsetHeight-35+document.body.scrollTop)degree=Math.round(Math.random()*45-112.5);
  55. if (document.all.pOiNtErS.style.pixelTop <= 2+document.body.scrollTop) degree = Math.round(Math.random()*45+67.5);//OK!
  56. if (document.all.pOiNtErS.style.pixelLeft <= 2+document.body.scrollLeft) degree = Math.round(Math.random()*45-22.5);//OK!
  57. }
  58. setTimeout('edges()',100);
  59. }
  60. function starteffect(){
  61. Curve();
  62. MoveRandom();// onUnload="opener.gO()"
  63. edges();
  64. }
  65.  
  66. if (document.all||document.layers)
  67. window.onload=starteffect
  68. </script>
May 21 '06 #1
1 1761
Banfa
9,065 Expert Mod 8TB
Change this

[html]<img src='"+cursorpath+"' width=60 height=66>[/html]

to

[html]<a href="[NextPage]"><img border="0" src='"+cursorpath+"' width=60 height=66></a>[/html]
in 2 places
May 22 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: sklett | last post by:
Hi I have code that writes links, these links call a javascript function and pass in a url. So let;s say I have a client side function like this function DoIt( url ) { alert(url); }
5
by: Michael Jaeger | last post by:
Dear group, I administrate the web site of a German school (www.gymnasium-burgdorf.de\test.htm) and so far this site has been designed using HTML and CSS only. Due to the increasing number...
1
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: ...
8
by: Tom | last post by:
Please help. I need a quick little scrpit to place on a web page that will count how many days have passed since January 1, 1970. I have ZERO experience writing ANY scripts. Anyone have any...
16
by: michael | last post by:
Is it possible to get all href URLs contained in a unordered list and place them in an array? Or in fact two different arrays, differently named one for each <ul> group? <ul> <li><a...
2
by: Sergio del Amo | last post by:
Hi, I wrote some functionality for a Web Page with Javascript. My code works perfectly for Firefox but not for IE. I become some errors apparently all based in the same problem wich scapes to my...
28
by: Randy Starkey | last post by:
Hi, Does anyone know where I can get a script that show a little plus sign after a line of text, that when you click the plus sign, more text is revealed on that same page, like a continuing...
3
by: Shapper | last post by:
Hello, I am working on an ASP.NET/VB web site. I have several links including menu links. Considerer a want to load a page named page.aspx. I can do it using javascript. Or using this code:...
4
by: dsimmons | last post by:
On my website http://seasidequilters.blogspot.com/ I'm having a problem that someone thinks might be associated with Firefox browsers. I'm hoping to find someone in this forum that might be...
1
by: Steve M. | last post by:
Hello all. I have a dropdown list: <select name="select" class="mapMenu" onChange="JumpToIt(this)"> <option selected value="none">Select a Tool --</option> <option...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.