- This topic has 38 replies, 3 voices, and was last updated 4 years, 9 months ago by David.
-
AuthorPosts
-
June 10, 2019 at 3:01 pm #925274Andy
No joy I’m afraid, still only works on posts above the load more button.
June 10, 2019 at 4:41 pm #925324DavidStaffCustomer SupportCan you share a link to your site so i can see whats happening with the infinite scroll and the toggle wrapper?
June 11, 2019 at 2:51 am #925634AndyI’m developing locally using Local by Flywheel, I’ve added a public URL to my original post, but this will expire after a few hours, so hope it will be live long enough for you to see it.
June 11, 2019 at 3:07 am #925641DavidStaffCustomer SupportHmmm looks good to me:
https://www.loom.com/share/9a5b95af71c24b9c822f44058cee0c0b
Tested on Chrome, Firefox and Safari – all passed the test.
June 11, 2019 at 3:20 am #925653AndyYou need to test posts that are loaded from Infinite Scroll, such as ‘5 Dales Route, Peak District’.
June 11, 2019 at 3:45 am #925685DavidStaffCustomer SupportApologies the posts weren’t loading due the tunnel failing so didn’t notice they hadn’t changed. Not sure but could you try this instead:
jQuery('.generate-columns-container').on('click', '.accordion-toggle', function (event) { event.preventDefault(); jQuery(this).next().slideToggle('fast'); //Hide the other panels jQuery(".accordion-content").not(jQuery(this).next()).slideUp('fast'); //Switch toggle jQuery('.accordion-toggle.toggle-open').not(this).removeClass('toggle-open'); jQuery(this).toggleClass('toggle-open'); });
June 11, 2019 at 5:33 am #925777AndyExcuse my poor jquery knowledge but does that need to go between <script> tags? as on it’s own it just displays the code on the front-end.
June 11, 2019 at 5:36 am #925781DavidStaffCustomer SupportOops – yes within the Script tags
June 11, 2019 at 5:44 am #925792AndyHmmmmm, unfortunately not working at all now, not even on the posts loaded before infinite scroll.
June 11, 2019 at 5:49 am #925796DavidStaffCustomer SupportWorth a try – can you remove the JS ( leave the CSS ) and if the tunnel is still open then i can take a look in the dev tools.
June 11, 2019 at 7:20 am #926030Andyok done, live link should still be working.
June 11, 2019 at 9:05 am #926108DavidStaffCustomer SupportTry this function:
jQuery( document ).ready( function($) { var $container = $( '#main article' ).first().parent(); toggleFunction(); $container.on( 'append.infiniteScroll', function( event, response, path, items ) { toggleFunction(); } ); function toggleFunction() { $('.inside-article').on('click', '.accordion-toggle', function (event) { event.preventDefault(); $(this).next().slideToggle('fast'); //Hide the other panels $(".accordion-content").not($(this).next()).slideUp('fast'); //Switch toggle $('.accordion-toggle.toggle-open').not(this).removeClass('toggle-open'); $(this).toggleClass('toggle-open'); }); } });
June 11, 2019 at 9:20 am #926125AndyAlmost there! – It’s working perfectly on posts loaded by Infinite Scroll, but on posts loaded on page load when you click the accordion it opens and then quickly closes by itself.
June 11, 2019 at 9:45 am #926139DavidStaffCustomer SupportSo if you only have infinite scroll on ( no load more ) then on page load they open and immediately close?
June 11, 2019 at 10:06 am #926162AndyNo, after pressing the load more button, the posts positioned above the load more button open and then close immediately, whereas posts positioned below the #nav-below container behave correctly.
-
AuthorPosts
- You must be logged in to reply to this topic.