var element = document.getElementById('image_1'),
style = window.getComputedStyle(element),
top = style.getPropertyValue('top');
获取元素某一个计算好的属性
本文探讨了JavaScript中如何使用getComputedStyle获取元素top值,展示了前端开发者如何在实际项目中操作DOM元素的布局。
本文探讨了JavaScript中如何使用getComputedStyle获取元素top值,展示了前端开发者如何在实际项目中操作DOM元素的布局。
var element = document.getElementById('image_1'),
style = window.getComputedStyle(element),
top = style.getPropertyValue('top');

被折叠的 条评论
为什么被折叠?