Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1134938
    sk8trh8tr
    Participant

    Hello,

    I am running latest X, latest Cornerstone, latest WordPress, and The Grid v2.0.
    My website is http://www.backpacksandbridges.com

    I 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,
    Emmanuel

    #1135047
    Thai
    Moderator

    Hi 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 🙂

    #1135104
    sk8trh8tr
    Participant

    Awesome, works perfectly!
    thanks a million!

    #1135176
    Thai
    Moderator

    Glad it worked 🙂

    If you need anything else please let us know.

  • <script> jQuery(function($){ $("#no-reply-1134938 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>