Skip to content

Commit

Permalink
Fixing triggering the sticky keyword box
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronmaturen committed Mar 7, 2014
1 parent f9209d4 commit 86cdb17
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions hooks/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,16 @@ function HookInline_keywordsSearchAdditionalheaderjs()
});
<?php if($inline_keywords_sticky_panel)
{ ?>
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'});
}
}
});
<?php
Expand Down

0 comments on commit 86cdb17

Please sign in to comment.