Go Back   PCMech Forums > Help & Discussion > Web Design / Development

Need Some Help? Type Your Keywords Here:

Reply
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Old 07-19-2004, 03:26 AM   #1
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
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?
icallmedan is offline   Reply With Quote
Old 07-19-2004, 12:47 PM   #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
kram 2.0 is offline   Reply With Quote
Old 07-19-2004, 01:02 PM   #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.
__________________
WhatsThisBoxFor? is offline   Reply With Quote
Old 07-19-2004, 05:17 PM   #4
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
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!
icallmedan is offline   Reply With Quote
Old 07-19-2004, 05:24 PM   #5
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
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.
icallmedan is offline   Reply With Quote
Old 07-21-2004, 09:48 PM   #6
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
Bump...any help?
icallmedan is offline   Reply With Quote
Old 07-21-2004, 10:27 PM   #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
kram 2.0 is offline   Reply With Quote
Old 07-21-2004, 10:46 PM   #8
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
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.
icallmedan is offline   Reply With Quote
Old 07-22-2004, 12:05 AM   #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>
WhatsThisBoxFor? is offline   Reply With Quote
Old 07-22-2004, 07:03 AM   #10
Member (7 bit)
 
Join Date: Mar 2004
Location: Sacramento, CA
Posts: 86
Send a message via AIM to mrdeeye
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
mrdeeye is offline   Reply With Quote
Old 07-22-2004, 11:12 AM   #11
Member (12 bit)
 
icallmedan's Avatar
 
Join Date: Mar 2003
Posts: 2,309
Send a message via AIM to icallmedan
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.
icallmedan is offline   Reply With Quote
Old 07-22-2004, 11:32 AM   #12
Member (8 bit)
 
neouser99's Avatar
 
Join Date: Jun 2004
Location: Kansas City, MO
Posts: 157
Send a message via AIM to neouser99
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
neouser99 is offline   Reply With Quote
Reply

Bookmarks

Still Need Help? Type Your Keywords Here:


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 06:49 AM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
SEO by vBSEO 3.6.0 PL2