This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Styling adjustments…

#10307
Ernest MarcinkoErnest Marcinko
Keymaster

This is only solveable by javascript only, as CSS cannot detect the scrolling.

I would try this script something like this:

[html]jQuery(function($) {
$(window).scroll(function(){
if ($(this).scrollTop() > 10) {
$(‘#ajaxsearchprores1_1’).addClass(‘scrolled_top’);
} else {
$(‘#ajaxsearchprores1_1’).removeClass(‘scrolled_top’);
}
});
});[/html]

This will check the scroll position and add a class called “scrolled_top” to the result element if the scroll is greater than 10.

Then instead of the previous CSS, use these two:

[html]div.ajaxsearchpro[id*=ajaxsearchprores1_].vertical {
position: fixed !important;
top: 120px !important;
}

div.ajaxsearchpro[id*=ajaxsearchprores1_].vertical.scrolled_top {
position: fixed !important;
top: 90px !important;
}[/html]

The script will swap the scrolled_top class on/off, and in CSS the top is specified differently for each class.