diff --git a/hooks/search.php b/hooks/search.php index 65f7280..4f7dc4e 100644 --- a/hooks/search.php +++ b/hooks/search.php @@ -48,13 +48,16 @@ function HookInline_keywordsSearchAdditionalheaderjs() }); - var panelTop = jQuery('.keywordPanel').eq(0).offset().top; - jQuery(window).scroll(function(){ - if(jQuery(window).scrollTop() > (panelTop - 20)){ - jQuery('.keywordPanel').css({'position':'fixed','top':'20px'}); - }else{ - jQuery('.keywordPanel').css({'position':'static','top':'20px'}); + jQuery('#UICenter').scroll(function(){ + var kpanel = jQuery('.keywordPanel'); + if(kpanel){ + var panelTop = kpanel.eq(0).offset().top; + if(jQuery('#UICenter').scrollTop() > (panelTop - 20)){ + jQuery('.keywordPanel').css({'position':'fixed','top':'20px'}); + }else{ + jQuery('.keywordPanel').css({'position':'static','top':'20px'}); + } } });