我将此添加到头部,但无法正常工作:
<script>
var xpathname = (window.location.pathname);
if (xpathname ==('/')) {
$('body').addClass('home');
}
</script>
该站点位于:http : //xotdr.unxpr.servertrust.com/
Volusion不允许开发人员自由编写代码,因此不幸的是,我需要实现许多变通方法。
编辑:我希望该类仅显示在主页上body
。
由于您已将其添加到中,因此head
您需要在body
标记可用时执行以下代码段:
$(function() {
var xpathname = window.location.pathname;
if (xpathname == '/') {
$('body').addClass('home');
}
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句