Hiding 'insert' curson when hovering over text

Discussion in 'Javascript' started by Paul M., Jul 24, 2003.

  1. Paul M.

    Paul M. Guest

    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
     
    Paul M., Jul 24, 2003
    #1
    1. Advertising

  2. 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." <> wrote in message
    news:...
    > 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
     
    Vjekoslav Begovic, Jul 24, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. GD
    Replies:
    4
    Views:
    2,235
    =?Utf-8?B?Q3VydF9DIFtNVlBd?=
    Sep 13, 2005
  2. Shannon Cayze

    Hovering elements over each other

    Shannon Cayze, Dec 9, 2008, in forum: HTML
    Replies:
    2
    Views:
    493
    ksamdev
    Dec 14, 2008
  3. jef
    Replies:
    1
    Views:
    127
    Eliyahu Goldin
    Apr 12, 2005
  4. Replies:
    1
    Views:
    126
    kaeli
    Jan 20, 2004
  5. Replies:
    4
    Views:
    175
Loading...

Share This Page