Swipe.js中swipe.scrollTo屬性中的函數(shù)最后返回this干嘛????
? ? swipe.scrollTo = function(x, speed) {
? ? ? ? //執(zhí)行動畫移動
? ? ? ? element.css({
? ? ? ? ? ? 'transition-timing-function' : 'linear',
? ? ? ? ? ? 'transition-duration' ? ? ? ?: speed + 'ms',
? ? ? ? ? ? 'transform' ? ? ? ? ? ? ? ? ?: 'translate3d(-' + x + 'px,0px,0px)'
? ? ? ? });
? ? ? ? console.log(this);
? ? ? ? return this;
? ? };
2017-01-10
這是為了鏈式調(diào)用,所以最后會返回該對象