/*

 

function getCss(obj,attr){

   return window.getComputedStyle ? window.getComputedStyle(obj,null)[attr] :obj.currentStyle[attr];

}

obj.style.left="354.568px";

var left=parseFloat(getCss(obj,"left"));//354.568;

obj.offsetLeft  //355

 



left top 可以设置小数数值
并且获取得到的时候也可以得到小数数值

offsetLeft 获取的只能是整数!!

*/

相关文章:

  • 2022-02-22
猜你喜欢
  • 2021-12-27
  • 2021-09-26
  • 2021-12-11
相关资源
相似解决方案