Reply To: Can i edit margins for vertical results depending if header is sticky or normal?

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Can i edit margins for vertical results depending if header is sticky or normal? Reply To: Can i edit margins for vertical results depending if header is sticky or normal?

#16665
Ernest Marcinko
Ernest Marcinko
Keymaster

Hi,

It is sort of a “intended” behaviour. Let me explain why. The results and the options container is snapped to the main body element, to avoid fixed positioning, and so absolute position can be used instead. The reason for that, is that this way, z-indexes can be adjusted relative to other elements, while in fixed positions it would always appear above everything, which is not desired in most cases. However in cases when the search is placed to a fixed element, the results of course remain in an absolute position, but the script will always try to fix any gaps that appear during scrolling due to the difference of fixed and absolute positioned elements. There is a minor delay added to that, so this is not happenning during every scroll ‘tick’, but whenever the scrolling is finished – causing the snapping. The delay is added for performance reasons.
However, a much smoother transition will be added to the next release to fix that.

For now, the best bypass fix would be using a custom CSS to force a fixed position on the results, like so:

.asp_r_1 {
    position: fixed !important;
    top: 130px !important;
}

.asp_r_1.asp_sticky {
    position: fixed !important;
    top: 80px !important;
}

In this case there will be one snappy adjustment, whenever the sticky scrolling starts, but after that, the results should be fixed to that position, without further movements.

I hope this helps.

Best,
Ernest Marcinko

If you like my products, don't forget to rate them on codecanyon :)