Knockoutjs: ScrollIntoViewTrigger
i recently struggled with a problem and although i solved it for me, i'm not sure whether there aren't better solutions out there, so I'd appreciate any comments. Problem. i wanted to create a 'ScrollIntoView' binding. Since scrolling an element into view, requires the DOM-Element, i wrote a custom binding, which i then wanted to explicitly trigger, whenever i pleased. I started with this code: ko.bindingHandlers.scrollTo = { update: function (element, valueAccessor, allBindings) { var _value = valueAccessor(); var _valueUnwrapped = ko.unwrap(_value); if (_valueUnwrapped) { element