Web Analytics Made Easy -
StatCounter How Javascript synchronises the image with the activated button - CodingForum

Announcement

Collapse
No announcement yet.

How Javascript synchronises the image with the activated button

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How Javascript synchronises the image with the activated button

    Hi,

    Does any know how to use javascript to access the hover style or the active state of the css like the example below?

    http://lauthiamkok.net/tmp/gt/slide/

    If it is nothing to do with the hover or the active state, how can we synchronise the image with the activated button?

    Many thanks,
    Lau

  • #2
    I suppose you could ask an object what it's current style is and, from that, infer what CSS state it is in. But that's a lot of work, in comparison to simply using
    <img ... onmouseover="over(this)" onmouseout="out(this)">

    That is, when the mouse moves over the image, the function over( ) is called, with a reference to the image object passed along. Similarly, when the mouse exits the boundary of the object, the out( ) function is called. Keep it simple.
    Be yourself. No one else is as qualified.

    Comment

    Working...
    X