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;
};
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?
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.
is working on a reply...