[英]Get bottom value of div using jquery
<div id="xx" style="bottom:20px;"></div>
我如何获得#xx
的底值
You may use您可以使用
document.getElementById('xx').style.bottom;
You'll get the string '20px'
.你会得到字符串
'20px'
。
If you want it as a number, you'll have to parse it :如果你想要它作为一个数字,你必须解析它:
var nb = parseInt(document.getElementById('xx').style.bottom, 10);
在 jQuery 中:
$('#xx').css('bottom');
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.