Home › Forums › WoodMart support forum › Masonry grid auto scrolls to top after going back form product page › Reply To: Masonry grid auto scrolls to top after going back form product page
August 26, 2020 at 1:22 pm
#221405
[email protected]
Participant
Hi
Problem occurred sometimes(when images are not cached) and sometimes not(when images are cached).
I managed to solved this issue by disabling masonry option from theme options.
Gave aspect ratio to each product image via css.
&
Initialised isotope manually via custom JS
<script>
jQuery(document).ready(function(){
jQuery('.products.elements-grid').isotope({
// options
itemSelector: '.product-grid-item'
});
});
jQuery( document ).ajaxComplete(function() {
jQuery('.products.elements-grid').isotope({
// options
itemSelector: '.product-grid-item'
});
});
</script>
You can see I am using jQuery( document ).ajaxComplete() to detect ajaxcomplete which I don’t feel safe. Can you please provide event name when theme’s Ajax request is successful.
Thanks