How to cha开发者_Python百科nge the background of a text When mousemove using jquery/Js?
I need text highlighting for each character when the mouse is moved, not for the entire div and I want the previous mouse over event should also be highlighted.
I am trying this on iphone safari browser. touchmove event is calling once not continuously.
Is this more what you're looking for?
$("#MyElementID").mouseover(function() { $(this).attr("background-color", "red"); } );
I think the above is about right.
or use something like from the jQuery site;
$("#MyElementID").hover(
function () {
$(this).addClass("hover");
},
function () {
$(this).removeClass("hover");
}
);
精彩评论