开发者

change the background of a text When mousemove

开发者 https://www.devze.com 2023-01-15 03:25 出处:网络
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 pre

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

精彩评论

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