April 13, 2012

How do I create a highlight on mouseover?

Question by Jeff

On my page, if i mouseover a state, the hyperlink on the right changes to a hover style. Can someone suggest how I might make the opposite happen.. when I hover one of the hyperlinks on the right, the state is highlighted (as when I hover over the state itself)?

Answer by Starx

Get the id of the map area and trigger the mouseover event.

$('.staff').mouseover(function() {
    var id = $(this).attr("class").split("-")[1];
    $("#"+id).trigger('mouseover');
});

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!