Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Samuel Butler 8 posts 130 karma points c-trib
    Jan 24, 2019 @ 01:37
    Samuel Butler
    0

    Scroll To Element for Custom Dashboard

    Hi all,

    I am currently trying to add scroll to functionality for the Kompair package custom dashboard. What I am trying to achieve is that when a user clicks on an element, an Angularjs controller function is called with the id of the element to scroll to.

    I am having some issues getting the scrollable div element to scroll to the target element. Is there something special I need to do to achieve this for umbraco dashboards as the usual methods are not working for me?

    $scope.scrollTo = function (scrollTarget) {
     var target = $("#" + scrollTarget);
     var container = $(".umb-editor-container.umb-panel-body.umb-scrollable");
    
     if (!target) {
         return;
     }
    
      if (!container) {
        return;
      }
    
      container.scrollTop = target.offsetTop;
    };
    
  • Samuel Butler 8 posts 130 karma points c-trib
    Jan 24, 2019 @ 03:17
    Samuel Butler
    100

    Worked it out. I needed to use animate which I did try at first but not on the scrollable div itself, I was doing animate on the body.

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies