Tagged: masonry
-
AuthorPosts
-
April 4, 2021 at 5:59 pm #1292363
Hi there,
on one of my pages I would like to put several masonry gallery elements (4-6) to show the products within one category. The first and second masonry galleries load just fine, but as I scroll down, the third masonry gallery remains empty and doesn’t load their products/images until I scroll at the very end of the page and up again. The forth and fifth masonry sometimes don’t load at all and never before scrolling several times to the bottom of the page and up again.
I already checked the forum for solutions but neither seems to be working. Yes, lazyload is turned of in both, the Enfold performance settings and the Autoptimize settings as well.
Please help
Thanks a lot in advance..
Kind regards, ChrisApril 5, 2021 at 4:14 pm #1292534Hi chrizz06,
Can you try to disable Javascript file merging and compression in Enfold > Performance?
Also try to clear the browser cache.Best regards,
NikkoApril 5, 2021 at 6:24 pm #1292587Hi Nikko,
Thanks for your fast reply.
I turned off the js file merging in Enfold > Performance and it had no effect.. afterwards turned off all of the Performance settings, also without effect. Then I deactivated Autoptimize and Cache Enabler but the problem persists.
Best regards, ChrisApril 6, 2021 at 4:59 am #1292662Hi chrizz06,
Can you give us a screenshot of how it looks on your end?
I could see it working properly on my end and I don’t see any js errors as well.Best regards,
NikkoApril 6, 2021 at 4:03 pm #1292816Of course (see below)
When I first load the page and beginn scrolling down from the top of the page, the first two masonry load correctly, but the following masonry galleries (3 4 5) don’t load until I scroll to the very bottom of the page and scroll up again. Something additional I took note right now: if I reload the page as one of these not loaded galleries (whitespace) potentially are in the viewfield, all of them almost load properly on reload the page. But I just cant tell my customers to just scroll down and up again or reload the page if products dont show up :-)
Kind regards, ChrisApril 8, 2021 at 6:45 am #1293178Hi,
Thank you for the inquiry.
This might be an issue with the waypoint script, used by the theme to trigger animations on scroll. You may need to adjust the offset value of that function to trigger the animation earlier than usual. You could also move the masonry gallery higher up the page, or insert additional content below the gallery.
If you want to modify the script or function, please edit the enfold\js\shortcodes.js, look for the activate_waypoints script around line 217.
function activate_waypoints(container) { //activates simple css animations of the content once the user scrolls to an elements if($.fn.avia_waypoints) { if(typeof container == 'undefined'){ container = 'body';}; $('.avia_animate_when_visible', container).avia_waypoints(); $('.avia_animate_when_almost_visible', container).avia_waypoints({ offset: '80%'}); if(container == 'body') container = '.avia_desktop body'; $('.av-animated-generic', container).avia_waypoints({ offset: '95%'}); } }
We have to decrease the offset value to 50% or lower to trigger the animation once the elements are in view.
Best regards,
IsmaelMay 1, 2021 at 4:43 pm #1297719Thanks a lot for the reply
The last couple of days I tested all kind of value-combinations, but still the following masonry elements don’t load properly…
So I was thinking about a potential workaround to use just two instead of one masonry for each shop-category. Therefore I put a first masonry element at the beginning of the shop frontpage, with each of its pictures linking to a different masonry sorting category via ?psort=categoryslug ( https://kriesi.at/support/topic/direct-link-to-masonry-category/ ) within the second, big masonry showing all products. Like that, people can klick on a category and remain on the same page viewing the products of that category. Theoretically this should work and I already used the ?psort before, but somehow this time its just not working at all.
Please help, much appreciatedThanks a lot in advance
May 4, 2021 at 7:10 am #1298165Hi,
Thank you for the update.
The script is not working because this line is no longer valid.
$(window).load(function() {
The .load function is now deprecated, so you have to replace it with.
$(window).on("load", function() { // do things here });
— or —
$(document).ready(function() { // do things here });
Best regards,
IsmaelMay 8, 2021 at 5:59 pm #1299122Thanks a lot for all your help Ismael.
Unfortunately I still can’t get it working like before, even though I replaced the line like you metioned. Following is the code in functions.phpadd_action('wp_footer', 'ava_auto_click'); function ava_auto_click() { if(!$_GET["psort"]) return; ?> <script> (function($){ $(window).on("load", function() { <?php echo '$(".'. $_GET["psort"] .'_sort_button").trigger("click");'; ?> }); })(jQuery); </script> <?php }
I guess and hope we are almost there..
Kind regards, ChrisMay 11, 2021 at 9:35 am #1299615Hi,
Thank you for the update.
Did you remove the script? We cannot find it in the page anymore. Please post the login details in the private field so that we could check and test the script properly.
Best regards,
IsmaelMay 12, 2021 at 6:13 pm #1299980This reply has been marked as private.May 14, 2021 at 9:12 am #1300277 -
AuthorPosts
- You must be logged in to reply to this topic.