471,089 Members | 1,802 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,089 software developers and data experts.

Hiding 'insert' curson when hovering over text

Hi,
This might be more of an HTML question, but I'm encountering it via
a javascript function. I'm trying to do rollovers without using
images. Here's some of the code:

<script type="text/javascript">
var previousBgColor;
var previousTextColor;
function mouseOver(obj)
{
previousTextColor = obj.style.color;
previousBgColor = obj.bgColor;
obj.style.color='#9999ff';
obj.bgColor='#99cc66';
}
function mouseOut(obj)
{
obj.style.color = previousTextColor;
obj.bgColor = previousBgColor;
//alert(previousBgColor);
}
function goHref(link)
{
window.location='/index.html?category=' + link;
}
</script>

Here's how I call it in the <body>

<table ...>
<tr>
<td id="computers" class="navbarTop" bgcolor="#9999ff" width="25%"
onmouseover="mouseOver(this)"
onmouseout="mouseOut(this)"
onclick="goHref('computers')">Computers</td>
</tr>
...more of the same
</table>

from the external CSS:
..navbarTop {
color: blue;
font-weight: bold;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
}

All of this works OK-- colors change, links are followed, except when
I float the mouse over the actual text of the <td> (not the
background), it turns into an 'insert' cursor. Is there a way to
disable the insert cursor or to use an element which doesn't show an
insert cursor when hovering over text? I don't want to have to use
images, as much of the page is dynamic and I also don't have time to
make custom images. Thanks for any help.

Paul
Jul 20 '05 #1
1 2693
That's CSS issue.

This is what you need:

.navbarTop {
color: blue;
font-weight: bold;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
cursor: default;
^^^^
}

"Paul M." <pa************@mortgagefamily.com> wrote in message
news:f2*************************@posting.google.co m...
Hi,
This might be more of an HTML question, but I'm encountering it via
a javascript function. I'm trying to do rollovers without using
images. Here's some of the code:

<script type="text/javascript">
var previousBgColor;
var previousTextColor;
function mouseOver(obj)
{
previousTextColor = obj.style.color;
previousBgColor = obj.bgColor;
obj.style.color='#9999ff';
obj.bgColor='#99cc66';
}
function mouseOut(obj)
{
obj.style.color = previousTextColor;
obj.bgColor = previousBgColor;
//alert(previousBgColor);
}
function goHref(link)
{
window.location='/index.html?category=' + link;
}
</script>

Here's how I call it in the <body>

<table ...>
<tr>
<td id="computers" class="navbarTop" bgcolor="#9999ff" width="25%"
onmouseover="mouseOver(this)"
onmouseout="mouseOut(this)"
onclick="goHref('computers')">Computers</td>
</tr>
...more of the same
</table>

from the external CSS:
.navbarTop {
color: blue;
font-weight: bold;
text-align: center;
font-family: Arial, Helvetica, sans-serif;
}

All of this works OK-- colors change, links are followed, except when
I float the mouse over the actual text of the <td> (not the
background), it turns into an 'insert' cursor. Is there a way to
disable the insert cursor or to use an element which doesn't show an
insert cursor when hovering over text? I don't want to have to use
images, as much of the page is dynamic and I also don't have time to
make custom images. Thanks for any help.

Paul

Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by jason | last post: by
4 posts views Thread by Alan Seunarayan | last post: by
1 post views Thread by max | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.