tags:

views:

33

answers:

2

Hi,

I want to highlight a <span> using jQuery.effect('highlight'), but it fades out after a period of time.

How can I get the highlight to be persistent?

My code is:

 $('span').live('click', function () {
        $(this).effect("highlight", { color: "#ff3fff"});
    });
+2  A: 

I don't think the highlight effect has a persistant state, you could just set the background colour:

$('span').live('click', function () {
    $(this).css("backgroundColor", "#ff3fff");
});
ILMV
+1  A: 

If you're using UI, try this:

$('span').live('click', function () {
   $(this).animate({backgroundColor: '#aa0000', color: '#fff'}, 1000);
});

Since jQuery UI has the color plugin integrated, you can animate color fading aswell.

jAndy