其实这里是用js 来模拟构造函数,这种写法的具体详解,同学们可以看javascript高级编程的138页,就会明白为什么这么写了
2016-11-25
index.html中引用 var swipe = SwipeFun($('#content'));
在swipe.js中定义一个SwipeFun方法
function SwipeFun(container) {
var swipe = {};
swipe.scrollTo = function(x, speed) {.....};
return swipe;
}
在swipe.js中定义一个SwipeFun方法
function SwipeFun(container) {
var swipe = {};
swipe.scrollTo = function(x, speed) {.....};
return swipe;
}
2016-11-24