如何使用JQuery获取CSS属性的值? [英] How to get the value of a CSS property using JQuery?
本文介绍了如何使用JQuery获取CSS属性的值?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试将框A设置为跳到与框B相同的x位置.我该怎么做?我尝试了以下操作,但它不起作用(第二行):
I am trying to set a box A to jump to the same x-position as box B. How do I do this? I tried the following but it does not work (the second line):
$("#boxa").animate({
left: $("#boxb").left
}, 1000, function() { });
});
谢谢
山姆
推荐答案
都
$('#boxB').css('left');
或
$('#boxB').offset().left;
这篇关于如何使用JQuery获取CSS属性的值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文