Commit ee585b39 by lmf

修改轮播图跳转地址

parent 871e4dff
......@@ -28,17 +28,17 @@
require([
'jquery'
], function ($) {
$.fn.banner = function(options){ //fn是dom对象
$.fn.banner = function(options){
var that = this;
options = options || {};
this._obj = {
btn:options.btn===false ? false : true, //没传是undefined也是false
btn:options.btn===false ? false : true,
list:options.list===false ? false : true,
autoPlay:options.autoPlay===false ? false : true,
delayTime:options.delayTime || 2000,
moveTime:options.moveTime || 200,
index:options.index || 0,
iPrev:options.img.length-1,//可有可不有
iPrev:options.img.length-1,
img:options.img || [],
href:options.href || [],
};
......@@ -69,7 +69,7 @@
});
}
this._obj.init();
this._obj.leftClick=function () {//this是left
this._obj.leftClick=function () {
if (that._obj.index ==0){
that._obj.index = that._obj.img.length-1;
that._obj.iPrev=0;
......@@ -79,8 +79,7 @@
}
that._obj.btnMove(1);
}
//点击右边的按钮
this._obj.rightClick=function(){//this是right
this._obj.rightClick=function(){
if (that._obj.index ==that._obj.img.length-1){
that._obj.index = 0;
that._obj.iPrev=that._obj.img.length-1;
......@@ -197,7 +196,7 @@
}
$(".banner1").banner({
img: img_arr,
href: ["/hotsale.html", "/newarrivals.html"],
href: ["/shapewear", "/shapewear"],
btn: true,
list: true,
autoPlay: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment