Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1152378
    fsyingc
    Participant

    Hello,

    How do I push the content dock over just a little bit to the left so it doesn’t cover up the “Scroll Up” button that also appears once a user has scrolled down the page? I want to keep the dock on the right side if possible instead of moving it to the left.

    Wordpress: 4.6
    X version: 4.6.1
    Cornerstone: 1.3.1

    Scroll down and see the content dock covering the scroll button currently.

    Thank you!

    #1152379
    fsyingc
    Participant
    This reply has been marked as private.
    #1152799
    Friech
    Moderator

    Hi There,

    Thanks for writing in! You can add this under Custom > JavaScript in the Customizer.

    jQuery(document).ready(function($) {
    
          $.fn.scrollBottom = function() {
            return $(document).height() - this.scrollTop() - this.height();
          };
    
          var executed             = false;
          var windowObj            = $(window);
          var body                 = $('body');
          var bodyOffsetBottom     = windowObj.scrollBottom();
          var bodyHeightAdjustment = body.height() - bodyOffsetBottom;
          var bodyHeightAdjusted   = body.height() - bodyHeightAdjustment;
          var contentDock          = $('.x-content-dock');
    
          function sizingUpdate() {
            var bodyOffsetTop = windowObj.scrollTop();
            if ( bodyOffsetTop > ( bodyHeightAdjusted * 0.5 ) ) {
              if ( ! executed ) {
                executed = true;
                contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '50px');
              }
            }
            $('.x-close-content-dock').click(function(e) {
              e.preventDefault();
              contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '-500px');
            });
          }
    
          windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
          sizingUpdate();
    
        });

    Hope it helps, Cheers!

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