Tagged: x
-
AuthorPosts
-
August 17, 2016 at 4:50 am #1134938
sk8trh8trParticipantHello,
I am running latest X, latest Cornerstone, latest WordPress, and The Grid v2.0.
My website is http://www.backpacksandbridges.comI asked The Grid support on this issue who reverted me back to you.
I want to add some custom JS throughout the site, so that The Grid pages snap to the top of the grid when changing pages (within The Grid). They provided me with this code:$('.tg-page').on('click', function() { $('html,body').animate({ scrollTop: $(this).closest('.tg-grid-wrapper').offset().top - 80 },'slow'); });When I put it in an individual grid it works perfectly. However when I put it in X’s overall Custom/JS, it does nothing.
Any help much appreciated,
EmmanuelAugust 17, 2016 at 6:27 am #1135047
ThaiModeratorHi There,
Please try with this code instead:
(function($){ $('.tg-page').on('click', function() { $('html,body').animate({ scrollTop: $(this).closest('.tg-grid-wrapper').offset().top - 80 },'slow'); }); })(jQuery);Hope it helps 🙂
August 17, 2016 at 7:36 am #1135104
sk8trh8trParticipantAwesome, works perfectly!
thanks a million!August 17, 2016 at 8:35 am #1135176
ThaiModeratorGlad it worked 🙂
If you need anything else please let us know.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1134938 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
