페이지가 body.home
인 경우에만 에 + 450
을 추가하고 싶습니다. 이 같은 뭔가 :변수 선언 내에 조건문을 추가하는 방법이 있습니까?
var headHeight = jQuery('#masthead-space').height() + 23;
var threshold = jQuery('.PopularTabsWidget').offset().top - headHeight (if body.home) + 450;
jQuery(window).scroll(function() {
if (jQuery(window).scrollTop() >= threshold)
jQuery('.PopularTabsWidget').addClass('fixed');
else
jQuery('.PopularTabsWidget').removeClass('fixed');
});
당신이 body.home 경우 무엇을 의미합니까하려고 사용 방지하려면? –