Jquery effect highlighting not working

I bang my head against the wall using the selection feature I use a lot for.

In the console, when I run:

$('.2').effect('highlight', {}, 3000);

      

It returns:

[...]

Which element I would like to highlight. However, it doesn't highlight it and I don't get any errors.

Funny story because when it works; but what I like about highlighting is it initially has a duration to remove the selection.

$(".2").css({ backgroundColor: "#FFFF88" });

      

Any ideas are appreciated!

http://jsfiddle.net/XxyjE/1/

+3


source to share


3 answers


What else are you setting the background color for this element? On these items above?

eg. I notice this issue occurs with dark colors on Twitter. Boot class. They appear to be coloring the TD, which means you can highlight the dark TRs until you are blue in the face and you still don't see the color change.

Try:



$('.2 *').effect('highlight', {}, 3000) 

      

if you want to confirm it or not. Then try looking for a more specific selector from there.

+7


source


$.fn.highlight = function(){
  this.css("background", "#ffff99")
  var self = this;
  setTimeout(function(){
    self.css("background", "inherit");
  }, 500);
};

      



0


source


This is an old question that I know, but I recently ran into a similar issue and wanted to share a fix for others who have similar issues.

The problem was that the element I was trying to highlight had a transition

CSS property and this was apparently interfering with the highlighting effect (making it completely invisible).

0


source







All Articles