jQuery.css(): Firefox don't return 'auto' values

前端 未结 4 1088
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-17 19:43

I\'m setting top or bottom and left or right values to a few elements. When i\'m trying to access this values with Firefox (16.0.2), i get a wrong value for top

4条回答
  •  心在旅途
    2020-12-17 20:16

    You Can Get integer Value of top when you set 'auto' with below code:

    $(function(){
        var top = $('div').offset().top;
        alert(top);
    });​
    
    • offset Return Position Value When you Set To Auto

提交回复
热议问题