调整 carousel 的 `jump` 方法为 `goto`

pull/1216/head
贤心 2023-03-14 09:55:50 +08:00
parent 23202137e1
commit 235d9fd40f
1 changed files with 3 additions and 3 deletions

View File

@ -196,7 +196,7 @@ layui.define('jquery', function(exports){
}; };
// 跳转到特定下标 // 跳转到特定下标
Class.prototype.jump = function(index){ Class.prototype.goto = function(index){
var that = this; var that = this;
var options = that.config; var options = that.config;
@ -236,9 +236,9 @@ layui.define('jquery', function(exports){
tplInd.css('margin-top', -(tplInd.height()/2)); tplInd.css('margin-top', -(tplInd.height()/2));
} }
//事件 // 事件
tplInd.find('li').on(options.trigger === 'hover' ? 'mouseover' : options.trigger, function(){ tplInd.find('li').on(options.trigger === 'hover' ? 'mouseover' : options.trigger, function(){
that.jump($(this).index()); that.goto($(this).index());
}); });
}; };