【发布时间】:2014-05-02 15:52:54
【问题描述】:
我知道以像素为单位您可以执行此类操作,但使用百分比时,不会返回任何内容。如果我的 CSS 使用百分比,我将如何处理?我基本上需要查看具有特定值的 div,然后触发我的脚本的变体。
jQuery:
if ($(".modPopUp").css("width") == "32%" ){
console.log("32%");
$(".modPopUp:nth-child(3n-2)").css('margin-left', '0');
}
else if ($(".modPopUp").css("width") == "49%" ){
console.log("49%");
$(".modPopUp:nth-child(2n)").css('margin-left', '0');
}
【问题讨论】:
标签: jquery