jquery 获取css position的值

jquery 获取css position的值

CreateTime--2018年5月28日14:03:12

Author:Marydon

1.情景展示

<div id="aa" style="position:relative">测试</div>

2.实现方式

1.方式一:使用javascript获取

window.onload = function() {
    alert(document.getElementById('aa').style.position);
};

2.方式二:使用jquery获取

$(function(){
    alert($('#aa').css('position'));
});

 

 相关推荐:

 

posted @ 2018-05-28 14:09  Marydon  阅读(860)  评论(0编辑  收藏  举报