JavaScript Reset

You can make smooth scroll animations to move from one part of a web page to another. Currently, some browsers (such as Chrome for Mac) support scrolling, and often scrolling involves reprogramming.

Thus, traditional scroll animations look completely artificial without crossover. Is there a way to reprogram the webpage using JavaScript to enhance the traditional scroll animation?

+5
source share
2 answers

Yes, you can do a return animation.

I assume you wanted to say about the return https://ux.stackexchange.com/questions/13183/name-of-the-touch-ui-overscroll-feature

/.

var threshold = 400,
    wrap = document.getElementById('wrap'),
    wrapHeight = wrap.offsetHeight,
    pageHeight = (wrapHeight + threshold);

wrap.style.height = pageHeight+'px';

window.addEventListener('scroll', function(){
    var pageY = window.pageYOffset;

    if (pageY > wrapHeight - threshold*1.5) {
        wrap.style.height = wrapHeight+'px';
    }
    if (wrap.offsetHeight === wrapHeight) {
        if ((pageY > wrapHeight - threshold*2.5) ) {
            wrap.style.height = pageHeight+'px';
        }
    }
});

https://github.com/andrewrjones/jquery.bounceback

: . reset .

, :   # {       -webkit-: .5 ;   }

+4

, jQuery overscrolling. , , . .

0

All Articles