例如

 

代码
$(document).ready(function(){

  
var DragElement=null;

  $(
"#zz").mousedown(function(){

  DragElement
=this;//这时this指的就是$("#zz")对象

  $(document).mousemove(
function(){

  如果直接$(
this).css("left")//由于是在mousemove内,这样this对象就不是$("#zz"),

  这时可以用$(DragElement).css(
"left")//这样取的就是$("#zz")

})

})

})

 

 

真是太好用了!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-25
  • 2021-10-15
  • 2021-12-28
  • 2021-12-14
  • 2022-01-20
  • 2022-12-23
猜你喜欢
  • 2021-11-27
  • 2021-06-27
  • 2022-01-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-11
相关资源
相似解决方案