javascript - Animate video on scroll like iPhone 6 website -
I am trying to revive a video on such a scroll. I have an animated video on the scroll, but I'm trying to make some effort to get the video easily after the release of the musicwill. I'm not sure how should I go with this challenge, should I try to use a real smooth out function? Or should I do it any other way?
Here JS is the snippet of IT which is currently i and a live example.
function at least (T, B, C, D) {return C * (T = T / D-1) * T * T * T * T + 1 + + B ; }; Var $ win = $ (window), $ video = $ ('video'), frame rate = 29.97, target = 0, scroll = 0, ticketing, scroll timeout, delta, target; Var scroll video = function () {this.scrollY = 0; $ Win.on ('MouseWill DomusScroll', this. On scroll, .bind (this)); }; ScrollVideo.prototype = {/ ** * Callback for our scroll event * Keeps track of previous scroll value * / onScroll: function (event) {var e = event.originalEvent? Event.originalEvent: Event; // Get the original event if available target available available + = (e.wheelDelta> 0?) -70: 70; If target (target = 0) = 0; Delta = Maath. Max (-1, Math.Man (1, (E. Vel Delta || -DDTET)); This.requestScrollTick (); }, / ** * calls RAF if it has not already been done * / requestScrollTick: function () {if (! IsTicking) {window.requestAnimationFrame (this.scrollHandler); } IsTicking = true; }, / ** * Animate accessories on scroll * / scroll handler: function () {scroll + = (target - scroll) * 0.1; Console.log (book); If (delta & lt; 0) {$ video [0] .currentTime + = (1 / frameline); } And {$ video [0] .currentTime - = (1 / frame); } // sticking ticking heating = fail; }}; Var Scroll Video = New Scroll Video ();
I would be happy to deal with this, any help / direction is highly appreciated.
Comments
Post a Comment