Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #677605

    Zeshan
    Member

    Hi there,

    I just went ahead and updated the content dock code from your Customizer > Custom > JS section to this:

    // Custom jQuery for Contact Dock
    jQuery(document).ready(function($) {
      if ( $('.x-iso-container').length ) {
        $.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();
    
          console.log( bodyOffsetTop, bodyHeightAdjusted, bodyHeightAdjusted * 0.25 );
    
          if ( bodyOffsetTop > ( bodyHeightAdjusted * 0.25 ) ) {
            if ( ! executed ) {
              executed = true;
              contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '20px');
            }
          }
          $('.x-close-content-dock').click(function(e) {
            e.preventDefault();
            contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '-450px');
          });
        }
        windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
        sizingUpdate();
      }
    });// Custom jQuery for Contact Dock
    jQuery(document).ready(function($) {
      if ( $('.x-iso-container').length ) {
        $.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();
    
          console.log( bodyOffsetTop, bodyHeightAdjusted, bodyHeightAdjusted * 0.25 );
    
          if ( bodyOffsetTop > ( bodyHeightAdjusted * 0.25 ) ) {
            if ( ! executed ) {
              executed = true;
              contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '20px');
            }
          }
          $('.x-close-content-dock').click(function(e) {
            e.preventDefault();
            contentDock.toggleClass('x-content-dock-off').toggleClass('x-content-dock-on').css('right', '-450px');
          });
        }
        windowObj.bind('scroll', sizingUpdate).resize(sizingUpdate);
        sizingUpdate();
      }
    });
    

    I has resolved the issue you’re facing with contact dock on blog page.

    Hope this helps. 🙂

    Thank you!

    #677893

    xdanlad
    Participant

    Update: All was fixed with the above Custom Javascript.

    Thank you

    #677897

    Zeshan
    Member

    You’re most welcome! 🙂