if(div1.currentStyle){
//IE低版本
var top1=div1.currentStyle.top
}else{
//非IE低版本使用的方式
var top1=window.getComputedStyle(div1).top
}
javaScript:获取非行间样式的属性值(获取div1对象的top属性的值,距离顶部的距离)
最新推荐文章于 2023-09-04 15:09:39 发布
if(div1.currentStyle){
//IE低版本
var top1=div1.currentStyle.top
}else{
//非IE低版本使用的方式
var top1=window.getComputedStyle(div1).top
}