When you get a mouseover event, create a timer that will run in a few seconds. It should check if mouse is still over that block and if it wasn't moved to another block and then trigger permanent highlight.
I'd code it like this:
Code:
var mouseCounter = 0,
lastItem = false;
$('.whatever').mouseover(function()
{
if($(this).hasClass('perma-hover')) return; // already highlighted
mouseCounter ++;
lastItem = this;
setTimeout('checkMouse(' + mouseCounter + ')', 2000);
}).mouseout(function()
{
mouseCounter ++;
});
function checkMouse(counter)
{
// check if there was a mouseout event since timer was created
if(counter != mouseCounter) return;
$(lastItem).addClass('perma-hover');
}
Bookmarks