开发者

change the background of a text When mousemove

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");
  }
);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜