Onmouseover for complete novice

Discussion in 'HTML' started by CQMMAN, Nov 27, 2003.

  1. CQMMAN

    CQMMAN Guest

    Using IE6, trying to get text to change when I move the mouse over it by
    using the following code:

    <a href="#"
    onmouseover="setText('this')"onmouseout="setText('other')">that</a>

    Unfortunately, it isn't working and I can't figure out why.

    Any ideas?

    thanks
    CQMMAN, Nov 27, 2003
    #1
    1. Advertising

  2. CQMMAN <> wrote:
    > Using IE6, trying to get text to change when I move the mouse over it
    > by using the following code:
    >
    > <a href="#"
    > onmouseover="setText('this')"onmouseout="setText('other')">that</a>


    Try some CSS. In your <head>, put:

    <style type="text/css">
    a:hover
    {
    color: #FF0010;
    }
    </style>

    and then just make a normal link:

    <a href="#">that</a>
    --
    Michael Wilcox
    mjwilco at yahoo dot com
    Essential Tools for the Web Developer - http://mikewilcox.t35.com
    Michael Wilcox, Nov 27, 2003
    #2
    1. Advertising

  3. CQMMAN

    Sid Ismail Guest

    On Thu, 27 Nov 2003 14:37:44 -0000, "CQMMAN" <> wrote:

    : Using IE6, trying to get text to change when I move the mouse over it by
    : using the following code:
    :
    : <a href="#"
    : onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    :
    : Unfortunately, it isn't working and I can't figure out why.


    Why is a complete novice meddling with this Javascript crap?

    Sid
    Sid Ismail, Nov 27, 2003
    #3
  4. Sid Ismail wrote:
    > On Thu, 27 Nov 2003 14:37:44 -0000, "CQMMAN" <>
    > wrote:
    >
    >> Using IE6, trying to get text to change when I move the mouse over
    >> it by using the following code:
    >>
    >> <a href="#"
    >> onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    >>
    >> Unfortunately, it isn't working and I can't figure out why.

    >
    >
    > Why is a complete novice meddling with this Javascript crap?
    >


    because:

    o incomplete novices can't
    o those with moderate skill no longer bother

    does that help?

    --
    William Tasso - http://WilliamTasso.com
    William Tasso, Nov 27, 2003
    #4
  5. CQMMAN wrote:

    > <a href="#"
    > onmouseover="setText('this')"onmouseout="setText('other')">that</a>

    ^
    First of all, you need a space where I have indicated.

    Second of all, this isn't a link, so use <span> instead of <a>.

    Third of all, can we see where you have defined setText()?


    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Nov 27, 2003
    #5
  6. CQMMAN

    CQMMAN Guest

    "Sid Ismail" <> wrote in message
    news:...
    > On Thu, 27 Nov 2003 14:37:44 -0000, "CQMMAN" <> wrote:
    >
    > : Using IE6, trying to get text to change when I move the mouse over it by
    > : using the following code:
    > :
    > : <a href="#"
    > : onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    > :
    > : Unfortunately, it isn't working and I can't figure out why.
    >
    >
    > Why is a complete novice meddling with this Javascript crap?
    >
    > Sid
    >



    Any suggestions on doing this with HTML then?
    CQMMAN, Nov 27, 2003
    #6
  7. CQMMAN <> wrote:
    > Any suggestions on doing this with HTML then?


    Link (or text) with HTML, style it with CSS.
    --
    Michael Wilcox
    mjwilco at yahoo dot com
    Essential Tools for the Web Developer - http://mikewilcox.t35.com
    Michael Wilcox, Nov 27, 2003
    #7
  8. In article <bq51tj$1v3aoe$-berlin.de>,
    says...
    > Using IE6, trying to get text to change when I move the mouse over it by
    > using the following code:
    >
    > <a href="#"
    > onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    >
    > Unfortunately, it isn't working and I can't figure out why.
    >
    > Any ideas?


    What does setText() do? We're not mind readers, you know.

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
    Hywel Jenkins, Nov 27, 2003
    #8
  9. CQMMAN

    CQMMAN Guest

    "Hywel Jenkins" <> wrote in message
    news:...
    > In article <bq51tj$1v3aoe$-berlin.de>,
    > says...
    > > Using IE6, trying to get text to change when I move the mouse over it by
    > > using the following code:
    > >
    > > <a href="#"
    > > onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    > >
    > > Unfortunately, it isn't working and I can't figure out why.
    > >
    > > Any ideas?

    >
    > What does setText() do? We're not mind readers, you know.



    Well I thought it was a command to change the text at that location. Sorry,
    to be honest, I thought this would be a helpful group but with comments like
    yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
    somewhere else.

    Until everyone is born knowing HTML, we all have to start somewhere.
    CQMMAN, Nov 27, 2003
    #9
  10. CQMMAN wrote:

    > Well I thought [setText()] was a command to change the text at that
    > location.


    Well it's not. It's just a meaningless function name. You need another bit
    of Javascript to define what setText() does.

    That's why I said:
    | Third of all, can we see where you have defined setText()?

    > Sorry, to be honest, I thought this would be a helpful group but with
    > comments like yours ("We're not mind readers, you know.") and Sid's,
    > pehaps I need to go somewhere else.


    I think that a Javascript newsgroup might be more appropriate for your
    needs than an HTML one.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me - http://www.goddamn.co.uk/tobyink/?page=132
    Toby A Inkster, Nov 27, 2003
    #10
  11. CQMMAN wrote:
    > Well I thought it was a command to change the text at that location. Sorry,
    > to be honest, I thought this would be a helpful group but with comments like
    > yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
    > somewhere else.


    But we *aren't* mind readers. How were we supposed to know that you
    thought setText() would do that?
    Leif K-Brooks, Nov 27, 2003
    #11
  12. CQMMAN

    Sid Ismail Guest

    On Thu, 27 Nov 2003 17:52:59 -0000, "CQMMAN" <> wrote:


    : >
    : >
    : > Why is a complete novice meddling with this Javascript crap?
    : >
    : > Sid
    : >
    :
    :
    : Any suggestions on doing this with HTML then?
    :


    That's why I said "crap" - plse do not. :))

    Sid
    Sid Ismail, Nov 27, 2003
    #12
  13. CQMMAN

    CQMMAN Guest

    "Leif K-Brooks" <> wrote in message
    news:O1txb.117$...
    > CQMMAN wrote:
    > > Well I thought it was a command to change the text at that location.

    Sorry,
    > > to be honest, I thought this would be a helpful group but with comments

    like
    > > yours ("We're not mind readers, you know.") and Sid's, pehaps I need to

    go
    > > somewhere else.

    >
    > But we *aren't* mind readers. How were we supposed to know that you
    > thought setText() would do that?
    >


    By reading the top of my post where I wrote:

    "Using IE6, trying to get text to change when I move the mouse over it by
    using the following code:"

    I though that "trying to get the text to change" and "using the following
    code" would give it away. I really don't expect to have to explain what this
    means word for word. We all have a reasonable grasp of English otherwise we
    wouldn't be using this newsgroup.
    CQMMAN, Nov 27, 2003
    #13
  14. CQMMAN wrote:
    > By reading the top of my post where I wrote:
    >
    > "Using IE6, trying to get text to change when I move the mouse over it by
    > using the following code:"


    You didn't say where you thought the setText() function would come from,
    though. For all we knew, you were defining it yourself.
    Leif K-Brooks, Nov 27, 2003
    #14
  15. CQMMAN

    Ixon Guest

    U¿ytkownik "CQMMAN" <> napisa³ w wiadomo¶ci
    news:bq51tj$1v3aoe$-berlin.de...
    > Using IE6, trying to get text to change when I move the mouse over

    it by
    > using the following code:
    >
    > <a href="#"
    > onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    >
    > Unfortunately, it isn't working and I can't figure out why.
    >
    > Any ideas?
    >
    > thanks
    >
    >

    MAybe try this. It's not the best solution I think, but it works very
    good :)


    <html>
    <head>
    <title>Untitled</title>

    <style type="text/css">

    #layer1, #layer2{
    position:absolute;
    left:10;
    top:10;
    cursor:hand;
    }
    </style>
    </head>

    <body>

    <div id="layer1" style="visibility:visible"
    onMouseover="this.style.visibility='hidden';
    document.all['layer2'].style.visibility='visible'">something</div>
    <div id="layer2" style="visibility:hidden"
    onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
    e.visibility='visible'">else</div>


    </body>
    </html>

    Contents of both div's ('something' and 'else') may be links of
    course.

    Ixon- [PL]
    Ixon, Nov 27, 2003
    #15
  16. CQMMAN

    CQMMAN Guest


    >
    > <html>
    > <head>
    > <title>Untitled</title>
    >
    > <style type="text/css">
    >
    > #layer1, #layer2{
    > position:absolute;
    > left:10;
    > top:10;
    > cursor:hand;
    > }
    > </style>
    > </head>
    >
    > <body>
    >
    > <div id="layer1" style="visibility:visible"
    > onMouseover="this.style.visibility='hidden';
    > document.all['layer2'].style.visibility='visible'">something</div>
    > <div id="layer2" style="visibility:hidden"
    > onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
    > e.visibility='visible'">else</div>
    >
    >
    > </body>
    > </html>
    >
    > Contents of both div's ('something' and 'else') may be links of
    > course.
    >
    > Ixon- [PL]
    >


    Thanks for that, I will give it a shot..
    CQMMAN, Nov 27, 2003
    #16
  17. Ixon wrote:


    Missing doctype

    > <html>
    > <head>
    > <title>Untitled</title>
    >
    > <style type="text/css">
    >
    > #layer1, #layer2{


    /* Useless name */

    > position:absolute;
    > left:10;


    /* Missing unit */

    > top:10;


    /* Missing unit */

    > cursor:hand;


    /* Invalid, IE 5 specific junk. Use pointer */

    > }
    > </style>
    > </head>
    >
    > <body>
    >
    > <div id="layer1" style="visibility:visible"
    > onMouseover="this.style.visibility='hidden';
    > document.all['layer2'].style.visibility='visible'">something</div>
    > <div id="layer2" style="visibility:hidden"
    > onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
    > e.visibility='visible'">else</div>


    document.all is IE specific, you should use DOM

    Browsers without CSS support will display both versions at once.

    --
    David Dorward http://dorward.me.uk/
    David Dorward, Nov 27, 2003
    #17
  18. CQMMAN wrote:
    > Using IE6, trying to get text to change when I move the mouse over it
    > by using the following code:
    >
    > <a href="#"
    > onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    >
    > Unfortunately, it isn't working and I can't figure out why.
    >
    > Any ideas?
    >
    > thanks


    you could play around with something like this......
    not javascript, and I imagine something along these lines would be much more
    widely accesible than a js ready browser......


    a {position:absolute;top:0;left:10; background-color:white; height:170px;}
    a:hover {height:30px;}
    div {position:absolute;top:50px;left:10px;}
    ..............

    <div>lll</div>
    <a href="#">asdf</a>
    Disco Octopus, Nov 28, 2003
    #18
  19. CQMMAN

    Ixon Guest

    .....
    > >
    > > <div id="layer1" style="visibility:visible"
    > > onMouseover="this.style.visibility='hidden';
    > > document.all['layer2'].style.visibility='visible'">something</div>
    > > <div id="layer2" style="visibility:hidden"
    > >

    onMouseout="this.style.visibility='hidden';document.all['layer1'].styl
    > > e.visibility='visible'">else</div>

    >
    > document.all is IE specific, you should use DOM
    >
    > Browsers without CSS support will display both versions at once.
    >
    > --
    > David Dorward

    http://dorward.me.uk/


    Could you rewrite my example using DOM, please ?
    Ixon, Nov 28, 2003
    #19
  20. In article <bq5kr3$1q44jj$-berlin.de>,
    says...
    >
    > "Hywel Jenkins" <> wrote in message
    > news:...
    > > In article <bq51tj$1v3aoe$-berlin.de>,
    > > says...
    > > > Using IE6, trying to get text to change when I move the mouse over it by
    > > > using the following code:
    > > >
    > > > <a href="#"
    > > > onmouseover="setText('this')"onmouseout="setText('other')">that</a>
    > > >
    > > > Unfortunately, it isn't working and I can't figure out why.
    > > >
    > > > Any ideas?

    > >
    > > What does setText() do? We're not mind readers, you know.

    >
    >
    > Well I thought it was a command to change the text at that location.


    It may well be - how do we know? Apparently you're the only person that
    can know for sure.

    > Sorry,
    > to be honest, I thought this would be a helpful group but with comments like
    > yours ("We're not mind readers, you know.") and Sid's, pehaps I need to go
    > somewhere else.


    Perhaps. Bye.


    >
    > Until everyone is born knowing HTML, we all have to start somewhere.


    Especially when you're asking a JavaScript question. If you don't know
    what it does, don't use it.

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
    Hywel Jenkins, Nov 29, 2003
    #20
    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. ra

    VHDL novice question

    ra, Jul 13, 2004, in forum: VHDL
    Replies:
    6
    Views:
    2,819
    Allan Herriman
    Jul 13, 2004
  2. jbl
    Replies:
    2
    Views:
    465
    Joe Smith
    Dec 16, 2004
  3. Buttercup
    Replies:
    2
    Views:
    362
    Will Stuyvesant
    Sep 21, 2003
  4. mtait
    Replies:
    2
    Views:
    125
    mtait
    Sep 25, 2006
  5. pintreo mardi
    Replies:
    11
    Views:
    92
    Grant Edwards
    Jan 12, 2014
Loading...

Share This Page