[Javascript] What was last rollover?

Terry Riegel riegel at clearimageonline.com
Thu Oct 4 15:02:14 CDT 2007


>> I have three images on a web page with a css rollover condition,
>> such as:
>>
>> img1:hover  ------8<-----
>>
>> If the user moves his/her cursor over an image, then the border's
>> corresponding color changes -- no problems there.
>>
>> But, how can I determine which image was subject to the *last*
>> rollover?
>
> I don't think this info is stored anywhere.  You can fake it with
>
> var lastHover
>
> <img ... onmouseover="lastHover = this;">

May not account for images that intersect each other.

Terry



More information about the Javascript mailing list