我正在使用以下代码。第一个if
条件有效,但第二个if
条件无效。我不知道为什么?第二个也应该应用相同的 CSS if
。谁能告诉我这是为什么?
<script type="text/javascript">
if (location.pathname.indexOf("girl-clothing") != -1) {
$(".RetailPriceValue").css("cssText", "margin: -203px 0 0 0 !important;");
}
if (location.pathname.indexOf("http://www.xyz.com/girl-clothing/?sort=featured&page=2")!= -1) {
$(".RetailPriceValue").css("cssText", "margin:-220px 0 0 0 !important;");
}
</script>