Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

onmouseover, style.display & firefox 1

Status
Not open for further replies.

g0ste

Technical User
Feb 16, 2003
95
AU
Hello folks,

I have a problem which has me stumped. Perhaps it's a very simple solution, perhaps not.

The problem is basically, I have a [tt]onmouseover="stuff"[/tt] which works great in IE. However, in Firefox(2), nothing happens. The line of code that it is pertaining to is:


Code:
<div class="adminApprove" onmouseover="this.style.background='lemonchiffon'" 
onmouseout="this.style.background='white'" 
style="border-top-style:dotted; 
border-top-width:1px; 
border-top-color:#CCC;">
<span onmouseover="tt1.style.display='block'" onmouseout="tt1.style.display='none'" 
class="cName">
<input type="checkbox" /> Company Name Ltd</span>
<span class="cTel">xxxx xxx xxx</span>
<span class="cContact">Mr J Bloggs</span>
</div>

*NOTE - tt1 is a div layer that consists of css & html. It's [tt]display[/tt] is set to "none" within the css.

(please excuse the sloppiness of my code)
The error console tells me:

"Error: tt1 is not defined
Source File: file://xxxxxxxxxxxx/thispage.htm
Line: 1"

which is highlighting the doctype declaration: [tt]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"[/tt]

I have used the [tt]onmouseover[/tt] to call external things before, but some reason, it dislikes this one, and I cannot figure out why.

I would appreciate it if anyone can help me out or offer me advice, or point me in the direction of some resource(s) that has any nfo on this?

Thanks

________________________________
Top 10 reasons to procrastinate:
1)
 
Hi

That is invalid reference accepted only by Explorer.
Code:
<span onmouseover="[red]document.getElementById('[/red]tt1[red]')[/red].style.display='block'" onmouseout="[red]document.getElementById('[/red]tt1[red]')[/red].style.display='none'"
class="cName">
Assuming you mean that tt1 is the [tt]id[/tt] of the [tt]div[/tt].

Feherke.
 
That sorted it!

Thanks, feherke! Marry me please :)

I wasn't aware that what I was trying to do was Explorer only. I will remember that.

Much thanks :>



________________________________
Top 10 reasons to procrastinate:
1)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top