Skip to content

Commit

Permalink
Merge pull request #2 from anhulife/master
Browse files Browse the repository at this point in the history
添加是否需要切换的逻辑判断
  • Loading branch information
zhangxinxu committed Jan 9, 2015
2 parents 7acc584 + 03c29f7 commit 38e3887
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion jquery-powerSwitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,10 @@
// 切换的核心,所有的切换都要走这一步
// 面向切换面板元素设计的切换方法
var funSwitchable = function(indexWill) {
// 判断是否需要切换
if(indexWill == indexSelected){
return;
}
// 总的切换项目数,每次切换的项目数
var eleWillRelative = eleRelatives.slice(indexWill, indexWill + numSwitch);
var eleSelected = null, eleWillSelect = null, eleRelative = null;
Expand Down Expand Up @@ -692,4 +696,4 @@

return self;
};
})(window, jQuery);
})(window, jQuery);

0 comments on commit 38e3887

Please sign in to comment.