got it worked out I think.

Discussion in 'HTML' started by Richard, Oct 6, 2003.

  1. Richard

    Richard Guest

    Could it get any simpler?
    Found this little trick on a site and it works just fine.
    <a href="#" onMouseOver="document.image1.src='image2.jpg'">

    with an onmouseout, image1 is restored to it's place.
    Since there is no javascript involved per se, it should work in most
    browsers yes?
     
    Richard, Oct 6, 2003
    #1
    1. Advertising

  2. Richard schrieb:
    >
    > Could it get any simpler?
    > Found this little trick on a site and it works just fine.
    > <a href="#" onMouseOver="document.image1.src='image2.jpg'">
    >
    > with an onmouseout, image1 is restored to it's place.
    > Since there is no javascript involved per se, it should work in most
    > browsers yes?


    No, not at all. You simply put the javascript in the value of the
    onMouseOver attribute. onmouseover is an event handler, and event
    handler require a script engine (in this case the client-side javascript
    engine).


    Matthias
     
    Matthias Gutfeldt, Oct 6, 2003
    #2
    1. Advertising

  3. In article <>, anom@anom says...
    > Could it get any simpler?
    > Found this little trick on a site and it works just fine.
    > <a href="#" onMouseOver="document.image1.src='image2.jpg'">
    >
    > with an onmouseout, image1 is restored to it's place.
    > Since there is no javascript involved per se, it should work in most
    > browsers yes?


    What do you think the "onMouseOver" is? That's a JavaScript event. The
    code between the "" for the event is JavaScript. When JavaScript is
    missing the code won't even get touched as the onMouseOver event won't
    fire.

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
     
    Hywel Jenkins, Oct 6, 2003
    #3
  4. Richard

    Richard Guest

    Matthias wrote:

    > Richard schrieb:


    >> Could it get any simpler?
    >> Found this little trick on a site and it works just fine.
    >> <a href="#" onMouseOver="document.image1.src='image2.jpg'">


    >> with an onmouseout, image1 is restored to it's place.
    >> Since there is no javascript involved per se, it should work in most
    >> browsers yes?


    > No, not at all. You simply put the javascript in the value of the
    > onMouseOver attribute. onmouseover is an event handler, and event
    > handler require a script engine (in this case the client-side
    > javascript
    > engine).



    > Matthias


    That's what I always thought but never knew for sure.
    At least the trick works.
     
    Richard, Oct 6, 2003
    #4
  5. Richard

    Steve Pugh Guest

    "Richard" <anom@anom> wrote:

    >Could it get any simpler?
    >Found this little trick on a site and it works just fine.
    ><a href="#" onMouseOver="document.image1.src='image2.jpg'">
    >
    >with an onmouseout, image1 is restored to it's place.
    >Since there is no javascript involved per se, it should work in most
    >browsers yes?


    That is JavaScript.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, Oct 6, 2003
    #5
  6. In article <>, anom@anom says...
    > Matthias wrote:
    >
    > > Richard schrieb:

    >
    > >> Could it get any simpler?
    > >> Found this little trick on a site and it works just fine.
    > >> <a href="#" onMouseOver="document.image1.src='image2.jpg'">

    >
    > >> with an onmouseout, image1 is restored to it's place.
    > >> Since there is no javascript involved per se, it should work in most
    > >> browsers yes?

    >
    > > No, not at all. You simply put the javascript in the value of the
    > > onMouseOver attribute. onmouseover is an event handler, and event
    > > handler require a script engine (in this case the client-side
    > > javascript
    > > engine).


    > That's what I always thought but never knew for sure.
    > At least the trick works.


    What's the trick, though?

    --
    Hywel I do not eat quiche
    http://hyweljenkins.co.uk/
    http://hyweljenkins.co.uk/mfaq.php
     
    Hywel Jenkins, Oct 6, 2003
    #6
  7. Richard

    Jordge W. L. Guest

    Richard wrote:
    >
    > Could it get any simpler?
    > Found this little trick on a site and it works just fine.
    > <a href="#" onMouseOver="document.image1.src='image2.jpg'">


    ahhh!
    but there's another problem. it's very slow over the internet because
    the image is loaded
    everytime you move your mouse over the icon/image. and if the image is
    cached on your hard drive,
    it's still slow because you have to reference the file over the
    internet. so, it works, but
    not a good idea.

    >
    > with an onmouseout, image1 is restored to it's place.
    > Since there is no javascript involved per se, it should work in most
    > browsers yes?
     
    Jordge W. L., Oct 7, 2003
    #7
  8. "Richard" <anom@anom> wrote in message news:...
    > Since there is no javascript involved per se, it should work in most



    <script>
    document.image1.src='image2.jpg'
    </script>

    Also the images you're trying to load, won't be retrieved before you
    mouse-over the image. On a slow connection the reaction time of the
    mouseover will be too high.
     
    Woolly Mittens, Oct 7, 2003
    #8
    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. Steven Bethard

    Think you've got a new decorator syntax?

    Steven Bethard, Aug 16, 2004, in forum: Python
    Replies:
    1
    Views:
    281
    David Fraser
    Aug 19, 2004
  2. hg
    Replies:
    8
    Views:
    395
  3. grocery_stocker

    I think the question I just posted got lost.

    grocery_stocker, Jun 3, 2005, in forum: C Programming
    Replies:
    3
    Views:
    310
    Clark S. Cox III
    Jun 3, 2005
  4. Blubaugh, David A.
    Replies:
    0
    Views:
    274
    Blubaugh, David A.
    Sep 11, 2008
  5. Replies:
    0
    Views:
    113
Loading...

Share This Page