Jump to content

javascript doesn't work in mozilla


Akasha

Recommended Posts

HelloI found some code and used it for my website, and it works fine with IE but when i use it in Mozilla it doesn't work.I am a beginner with javascript so i doe not really know how ik can fix this or if its even fixableThe code shows a text when i rollover a link.This is the part in the head of the page

<script LANGUAGE="JavaScript"> var t var x = 450, y = 650 var txt = 0 document.write("<div id='text1' style='position:absolute;top:-80px;left:100px;width:400px;height:20px'><font size=+2 color='#CCCCCC'>Muziek</font></div>") document.write("<div id='text2' style='position:absolute;top:-80px;left:100px;width:400px;height:20px'><font size=+2 color='#CCCCCC'>Fotoos</font></div>") document.write("<div id='text3' style='position:absolute;top:-80px;left:100px;width:400px;height:20px'><font size=+2 color='#CCCCCC'>Video</font></div>")  </script> <script LANGUAGE="JavaScript"> function showtip(txt) { t=txt show() } function outtip(t) { clearTimeout(s) document.all["text"+t].style.pixelTop = -50 } function show() { document.all["text"+t].style.pixelTop = x document.all["text"+t].style.pixelLeft = ys=setTimeout("show()",10) } </script>

and this i sthe part in the body of the page

<a href="music.asp" onMouseover="showtip('1')" onMouseout="outtip('1')" target="_self"><img src="Images/music_icon.gif" border="0"></a><a href="galleries.asp" onMouseover="showtip('2')" onMouseout="outtip('2')" target="_self"><img src="Images/photo_icon.gif" border="0"></a><a href="videos.asp" onMouseover="showtip('3')" onMouseout="outtip('3')" target="_self"><img src="Images/video_icon.gif" border="0"></a>

how can i make it work in IE as wel in mozillathnx in advance

Link to comment
Share on other sites

well, what do you use in mozilla then???

Link to comment
Share on other sites

Ok thnx so i have created this, but still not working :)

function showtip(txt) { t=txt show() } function outtip(t) { clearTimeout(s)if (document.all) {document.all["text"+t].style.pixelTop = -50;}if (document.GetElementById) {document.GetElementById("text"+t).style.Top = -50;}}function show() { if (document.all) {document.all["text"+t].style.pixelTop = x;document.all["text"+t].style.pixelLeft = y;}if (document.GetElementById) {document.GetElementById("text"+t).style.Top = x;document.GetElementById("text"+t).style.Left = y;}s = setTimeout("show()",10)  }</script>

Link to comment
Share on other sites

Cool thnxonly problem now is.it doesn't disappear anymore

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...