473,770 Members | 1,826 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Need help with javascript links

1 New Member
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 1785
Banfa
9,065 Recognized Expert Moderator Expert
Change this

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

to

[html]<a href="[NextPage]"><img border="0" src='"+cursorpa th+"' 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
1452
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
2104
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 of submenu links I am thinking of switching to javascript, which seems to work fine on my PC so far (sorry, it's not online yet).
1
2016
by: Julius Mong | last post by:
Dear all, according to the ASV3 manual known problem section, to make an <a> execute some Javascript onclick: http://www.google.co.uk/search?q=cache:OPDjMJfL50sJ:www.adobe.com/svg/indepth/pdfs/ReadMewin.pdf+adobe+svg+javascript+problem&hl=en&ie=UTF-8#5 4. Due to design limitations of Netscape, avoid using HTML with the following form: <a href="#" onclick="myScriptWhichModifiesSVG()">The problem is that JavaScript responds to the onclick...
8
4676
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 suggestions? As for what is displayed on the screen, I just want it to say: Today is: 12578 (or however many days have passed since that date.)
16
4452
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 href="lemurs.html">Lemurs</a></li> <li><a href="chameleons.html">Chameleons</a></li> </ul> <ul>
2
2489
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 knowledge. If anyone can help me, i would be really grateful. These are the errors i was speaking about: -------------------------------------------- Line: 58
28
2604
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 paragraph. This will be on a web page. Thanks! --Randy Starkey
3
2127
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: Sub loadPage(sender As Object, e As System.EventArgs, pageURL as String)
4
2164
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 willing to check my website with Firefox. Sounds like I might have a float problem/div problem that is visible to Firefox users only Here is my problem: >From my PC and majority of viewers of my webpage they see the Flickr badge (photos) on the...
1
9359
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 value="javascript:onCreatePrintable()">Print Map</option> <option value="javascript:onFindLatLong()">Find Lat/Long</option> </select>
0
10099
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10037
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8931
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7456
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6710
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5354
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5482
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.