|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (12 bit)
|
onmouseout doesn't work in Mozilla/Firefox
I know Mozilla is considered the Industry Standard and is often used to check for errors in web development....
I was programming some javascript for a test website, because I am trying to learn javascript, and I wanted some mouse rollovers... I simply wanted a link to change from yellow to green....I programmed it and it worked in IE, but the onmouseout function wouldn't work in Mozilla or Firefox... When I put the mouse over the lin it would turn green, I would remove it but it wouldn't change back...what is the problem? Does Mozilla not support 'onmouseout' for some reason? |
|
|
|
|
|
#2 |
|
Moderator
Staff
Premium Member
Join Date: Aug 2003
Location: Richmond, VA
Posts: 7,835
|
I think I know the problem - capitilization. Mozilla definately supports "OnMouseOut", as I've programmed scripts and such for webpages that definately work. Make sure that you have the caps correct - OnMouseOut. I had experiences where more selective code interpreters, as Netscape, didn't read the onmouseover command, and I tried Capitalizing and it worked. If that doesn't fix it, paste your script on here - we might be able to look over it.
Hope that helps, kram
__________________
"For today, goodbye. For tomorrow, good luck. And forever, Go Blue!"
University of Michigan President Mary Sue Coleman |
|
|
|
|
|
#3 |
|
PCMech: Saving Lives
Join Date: Apr 2004
Location: England, the United Kingdom
Posts: 1,839
|
I made a script like that, when I was learning, just checked on it (in Firefox) and it says onmouseout, not OnMouseOut and it works. Its still worth fixing all sloppy programming anyway.
|
|
|
|
|
|
#4 |
|
Member (12 bit)
|
Thanks Kram, I am going to try it...it just makes you feel dumb, when all of your errors are just capitalization...LOL! I had my mouseovers base on #00FF00 and that kept giving me erros, I tried #00ff00, and bam it worked....LOL!
|
|
|
|
|
|
#5 |
|
Member (12 bit)
|
That doesn't seem to be working.
The page i am using this with uses frames, and I have it labled as menu.html It can be found here(not working): http://home.comcast.net/~icallmedan/menu.html The actual site is: http://home.comcast.net/~icallmedan/ My code can be seen after you click one of those links...when I posted it here it parsed the HTML so it didn't work...just view the source using Mozilla or Firefox... Last edited by icallmedan; 07-19-2004 at 05:31 PM. |
|
|
|
|
|
#6 |
|
Member (12 bit)
|
Bump...any help?
|
|
|
|
|
|
#7 |
|
Moderator
Staff
Premium Member
Join Date: Aug 2003
Location: Richmond, VA
Posts: 7,835
|
I'm looking through the code right now, tried a few code restricting and such, and I think I found the problem. I see that you have one function doing all the work here - function rollover. So if the color is yellow, you would get it to change to green, but else, it would return to yellow. How Mozilla interprets this is strict coding - in other words, I think it sees the original code as the condition for the "If" statement. In other words, even after the onMouseOver command and the rollover has been executed, the original source code will still say that the color is yellow, therefore making the first if statement true. I would try to write another function and make that the OnMouseOut function.
I see you're really trying to get this to do with JavaScript - otherwise, I would have recommended doing it with just a simple CSS coding. This is at least what I thought when I saw the script - I might be wrong, as I sometimes am. However, the code looks standard and such, and I'd say it's just the Mozilla acting up - it works fine on MSIE. Hope that helps, kram |
|
|
|
|
|
#8 |
|
Member (12 bit)
|
Thanks kram, I'll try to write a second function, and see if that works. I'm not going to do it tonight because I am really tired.
|
|
|
|
|
|
#9 |
|
PCMech: Saving Lives
Join Date: Apr 2004
Location: England, the United Kingdom
Posts: 1,839
|
This does what you want:
HTML Code:
<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> <html> <head> <title>Harrisburg Computer Sales</title> <meta name="Generator" content="EditPlus"> <meta name="Author" content="DeToma"> <meta name="Keywords" content=""> <meta name="Description" content=""> <style> A:Link {color: #ffff00} A:Visted {color: #FF0000} A.menulink:hover {color: #00ff00} </style> </head> <body bgcolor="#0000ff" link="#ffff00" vlink="#ffff00"> <font face="Arial" color="#ffff00" size="3px"><b> <a id="A" href="main.html" target="mainwindow" class="menulink">Home</a> <a id="B" href="preconfig.html" target="mainwindow" class="menulink">Pre-Configured PCs</a> <a id="C" href="custom.html" target="mainwindow" class="menulink">Custom Built PCs</a> <a id="D" href="installation.html" target="mainwindow" class="menulink">Installations</a> <a id="E" href="training.html" target="mainwindow" class="menulink">Training</a> <a id="F" href="upgrades.html" target="mainwindow" class="menulink">Upgrades</a> <a id="G" href="support.html" target="mainwindow" class="menulink">Support</a> <a id="H" href="contact.html" target="mainwindow" class="menulink">Contact Information</a></b> </font> </body> </html> |
|
|
|
|
|
#10 |
|
Member (7 bit)
|
yeah i would stick with CSS for a simple rollover like that...its cross browser and you dont have to worry about if people have their javascript turned off or not...plus itll cut down on file size since there is less code to deal with....just my opinion
|
|
|
|
|
|
#11 |
|
Member (12 bit)
|
Ahhh....thank you so much Whatsthisboxfor? Guess it does the same thing, but I never really learned CSS, I geuss that is on my list too.
|
|
|
|
|
|
#12 |
|
Member (8 bit)
|
CSS is definately the way to go, and something that you should learn if you are going be doing some indepth websites, espeically since you can change entire site wide stuff, colors, widths, etc. The only thing that you have to watch out for, is IE doesn't render some CSS right. The biggest problem they have is that you can't have pages center by using the margin in IE, as it should, especially if the page is W3C transitional, it works if it is static, but not the newest standard. So just be careful.
this is the problem of IE, not the rest of the world just to let you know. -neo |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|