[Javascript] What was last rollover?

Marcelo Wolfgang grillo at gmail.com
Thu Oct 4 13:13:26 CDT 2007


I don't know if this works, just scripted from the top of my head, sure 
it could be cleaner:

<script>
var lastRollover = undefined
</script>

and on the images

<img src="" onrollover="lastRollover = this">

it SHOULD work

HTH
Marcelo Wolfgang



tedd wrote:
> Hi gang:
>
> I have three images on a web page with a css rollover condition, such as:
>
> img1:hover
> {
> border: 1px solid red;
> }
>
> img2:hover
> {
> border: 1px solid blue;
> }
>
> img3:hover
> {
> border: 1px solid green;
> }
>
> 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?
>
> Is there any way to do this?
>
> TIA.
>
> Cheers,
>
> tedd
>   




More information about the Javascript mailing list