此代码存在于swipe.js库中。我试图对其进行定制。返回之前的评论说'暴露了Swipe API',但我不确定这意味着什么。这个swipe.js函数返回什么?
function Swipe(container, options) {
...
//everything that makes the library work, including a setup() function
...
//expose the Swipe API
return {
setup: function() {
setup();
},
slide: function(to, speed) {
// cancel slideshow
stop();
slide(to, speed);
},
prev: function() {
// cancel slideshow
stop();
prev();
},
next: function() {
// cancel slideshow
stop();
next();
},...some more stuff
}
返回值是数组吗?数组列表?举例来说,我实例化一个新的滑动对象window['aNewSwipeObject'] = Swipe($theDOMElement);
,我调用setup()这样的函数window['aNewSwipeObject'].setup()
调用了什么setup()?返回上面的setup(),或Swipe()函数返回的匿名函数中的setup()?
对象文本! – adeneo