Skip to content
Advertisement

Tag: scrollto

Is it possible to add duration and easing to window.scrollTo?

I’m using Bill Miller’s Interactive Decision guide code. http://www.guiideas.com/2013/09/interactive-decision-guide.html To scroll new questions into view at the bottom of the page he uses window.scrollTo Is it possible to add duration and easing to window.scrollTo or is there an alternative method? Answer Try this: Comment out (or delete) window.scrollTo(0, difHigh); line inside the if (difHigh>0) {} clause. Add $(‘html,body’).animate({scrollTop:difHigh},400); instead. JavaScript

Advertisement