Welcome to WebmasterWorld Guest from 18.207.136.184

Forum Moderators: open

Message Too Old, No Replies

cursor doesn't change and link doesn't work in Firefox

style.cursor : hand doens't work

     
5:15 am on Mar 7, 2006 (gmt 0)

New User

10+ Year Member

joined:Mar 7, 2006
posts:2
votes: 0


Hi There,

I do have a strange problem in Firefox. I use a javascript in combination with html to make an interactive navigation bar.
Under internet explorer 6.x it works just fine, in firefox the script doesn't work.

I designed my navigation bar by making a one column multiple row table. Then putting text in the cells in the table which were links of course. Then when someone moves there mouse over a link the cell in the table the links in changes its background colour.

The first problem is, the link doesn't work in Firefox. I put the link outside " <td> " so if I click somewhere not the text but inside cell, the click would work. I have resolved it by using " onClick='' ", but anybody have ideas why it doesn't work in my Firefox?

The second problem is, mouse cursor didn't change when I move cursor to the cell.

Here's the codes.

<script language="javascript">
function fover(obj){
obj.style.backgroundColor = 'blue';
obj.style.cursor = 'hand';
}
function fout(obj){
obj.style.backgroundColor = '';
}
</script>
something here
<tr>
<a href="link.htm"><td valign="center" align="left" height="25" bgcolor="#808080" onMouseOver="fover(this)" onMouseOut="fout(this)"><font color="white">aaaa</font></td></a>
</tr>

Please help me.
I have searched the forum and didn't find any relevant topic.
Thank you.

6:34 am on Mar 7, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


Welcome to WebmasterWorld! [WebmasterWorld.com]

<td> is a block level element
<a> is an inline element

Block elements can contain inline elements, but not vice versa. That's why it doesn't work in Firefox. Also, the correct cursor style is "pointer".

As always, it's best to always validate your markup [validator.w3.org] and CSS [jigsaw.w3.org].

7:32 am on Mar 7, 2006 (gmt 0)

New User

10+ Year Member

joined:Mar 7, 2006
posts:2
votes: 0


Thanks for the answer.
It is very useful.

I had tried to place <a> inside <td> tag,
but it makes the area in the cell but not the text is not clickable. So I want to make all the cell is clickable.
Any ideas?

Anyway, thanks for suggestions. I'd tried "pointer" and it did work.

12:06 pm on Mar 7, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 2, 2003
posts:3710
votes: 0


If I understand you correctly (only glanced at this thread) try this...

<td><a href="page.html" style="display:block">click here</a></td>

Kaled.

7:01 pm on Mar 7, 2006 (gmt 0)

Senior Member

WebmasterWorld Senior Member drdoc is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Mar 15, 2002
posts:6807
votes: 0


kaled is right on the money :)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members