能否在Swipe中直接傳入?yún)?shù)
為什么不在調(diào)用Swipe的時(shí)候直接傳入?yún)?shù)呢?我試了下也可以啊 ?請(qǐng)問這樣做有什么不好?
swipe.scrollTo = function(x, speed) {
? ? ? ? //執(zhí)行動(dòng)畫移動(dòng)
? ? ? ? element.css({
? ? ? ? ? ? 'transition-timing-function' : 'linear',
? ? ? ? ? ? 'transition-duration' ? ? ? ?: speed + 'ms',
? ? ? ? ? ? 'transform' ? ? ? ? ? ? ? ? ?: 'translate3d(-' + x + 'px,0px,0px)'
? ? ? ? });
? ? ? ? return this;
? ? };
? ? return swipe;
}
這里return this和return swipe不太明白 ?
2016-08-20
return this:是返回根目錄
return swipe:是返回swipe