knockout.js - Scroll to a Div in KnockoutJS -
i trying create similar jquery scroll functionality scroll div
when pressed button didn't find solution in knockoutjs. please suggest approach?
$('html,body').animate({ scrolltop: $('#mydivwheretobescrolled').offset().top }, 1000);
you need call function in model , there need add code,
<button data-bind="click: yourfunction">scroll</button>
and in model
this.yourfunction = function(){ $('html,body').animate({ scrolltop: $('#mydivwheretobescrolled').offset().top }, 1000); }
let me know need.
i have created plunkr, please have http://plnkr.co/edit/j0dglzjt8sr2pj0u83fs?p=preview
Comments
Post a Comment