'
}];
```
-如果你想实现介绍部份提到的效果,你可以按以下格式设置:
+如果想实现介绍部份提到的效果,可以按以下格式设置:
-
深入了解iSlider
+##深入了解iSlider
这里提供对iSlider类选项最清楚的描述:
@@ -194,7 +193,7 @@ var data = [{
-
License (MIT)
+##License (MIT)
Copyright (c) 2014 BE-FE
diff --git a/demo/public/js/islider.js b/demo/public/js/islider.js
index b69fb0be..03501c21 100755
--- a/demo/public/js/islider.js
+++ b/demo/public/js/islider.js
@@ -316,7 +316,9 @@ iSlider.prototype._renderHTML = function () {
}
};
-// start loading image
+/**
+ * preload img when slideChange
+ */
iSlider.prototype._preloadImg = function(index) {
if (!this.data[index].loaded) {
var preloadImg = new Image();
@@ -325,7 +327,9 @@ iSlider.prototype._preloadImg = function(index) {
}
};
-// pre load image
+/**
+ * load extra imgs when renderHTML
+ */
iSlider.prototype._initLoadImg = function() {
var data = this.data;
var len = data.length;
@@ -553,6 +557,12 @@ iSlider.prototype._bindHandler = function() {
window.addEventListener('orientationchange', orientationchangeHandler);
};
+/**
+* simple event delegate method
+* @param {String} evtType event name
+* @param {String} selector the simple css selector like jQuery
+* @param {function} callback event callback
+*/
iSlider.prototype.bind = function(evtType, selector, callback) {
function handle(e){
var evt = window.event ? window.event : e;
@@ -564,6 +574,9 @@ iSlider.prototype.bind = function(evtType, selector, callback) {
this.outer.addEventListener(evtType, handle, false);
}
+/**
+* reset & rerender
+*/
iSlider.prototype.reset = function() {
this.pause();
this._setting();
@@ -604,4 +617,3 @@ iSlider.prototype.extend = function(plugin, main) {
Object.defineProperty(main, property, Object.getOwnPropertyDescriptor(plugin, property));
});
};
-
diff --git a/src/islider.js b/src/islider.js
index b69fb0be..03501c21 100755
--- a/src/islider.js
+++ b/src/islider.js
@@ -316,7 +316,9 @@ iSlider.prototype._renderHTML = function () {
}
};
-// start loading image
+/**
+ * preload img when slideChange
+ */
iSlider.prototype._preloadImg = function(index) {
if (!this.data[index].loaded) {
var preloadImg = new Image();
@@ -325,7 +327,9 @@ iSlider.prototype._preloadImg = function(index) {
}
};
-// pre load image
+/**
+ * load extra imgs when renderHTML
+ */
iSlider.prototype._initLoadImg = function() {
var data = this.data;
var len = data.length;
@@ -553,6 +557,12 @@ iSlider.prototype._bindHandler = function() {
window.addEventListener('orientationchange', orientationchangeHandler);
};
+/**
+* simple event delegate method
+* @param {String} evtType event name
+* @param {String} selector the simple css selector like jQuery
+* @param {function} callback event callback
+*/
iSlider.prototype.bind = function(evtType, selector, callback) {
function handle(e){
var evt = window.event ? window.event : e;
@@ -564,6 +574,9 @@ iSlider.prototype.bind = function(evtType, selector, callback) {
this.outer.addEventListener(evtType, handle, false);
}
+/**
+* reset & rerender
+*/
iSlider.prototype.reset = function() {
this.pause();
this._setting();
@@ -604,4 +617,3 @@ iSlider.prototype.extend = function(plugin, main) {
Object.defineProperty(main, property, Object.getOwnPropertyDescriptor(plugin, property));
});
};
-