幽灵资源网 Design By www.bzswh.com
复制代码 代码如下:
/**
* jQuery插件
* Author: purecolor@foxmail.com
* Date : 2011-02-25
* Params:
* defaults:{
currentClass:当前样式,
trigger:触发方式,
callBack:回调函数,
auto:是否自运行,
detay:延迟时间,
index:当前位置
* }
* Return: null
* Note : Tab选项框插件
*
*/
(function($){
$.fn.extend({
tabBuild:function(options){
return $(this).each(function(){
var defaults={
currentClass:"currentOne",
trigger:"mouseover",
callBack:null,
auto:true,
detay:3000,
index:0
}
var params=$.extend(defaults,options);
var $this=$(this);
var items=$('.tab-menu',$this),i=0;
var autoTimer,curro=0;
items.each(function(){
$(this).data('lvl',i);
if(i==params.index){
$('.tab-content',$this).eq(i).show();
$(this).addClass(params.currentClass);
}else{
$('.tab-content',$this).eq(i).hide();
}
i++;
$(this).bind(params.trigger,function(e){
//移除自动运行
if(params.auto){
if(autoTimer) clearInterval(autoTimer);
}
move($(this).data("lvl"));
//清除冒泡
if (e.stopPropagation) {
e.stopPropagation(); // for Mozilla and Opera
}
else if (window.event) {
window.event.cancelBubble = true; // for IE
}
});
});
//移动播放
function move(i){
//移除上一个效果
items.eq(params.index).removeClass(params.currentClass);
$('.tab-content',$this).eq(params.index).hide();
//移至当前位置
items.eq(i).addClass(params.currentClass);
$('.tab-content',$this).eq(i).show();
params.index=i;
}
//自动运行
function auto(){
if(params.auto){
autoTimer=setInterval(function(){
curro=(params.index>=2)?0:(params.index+1);
move(curro);
},params.detay);
}else{
if(autoTimer) clearInterval(autoTimer);
}
}
auto();
});
}
});
})(jQuery);
/**
* jQuery插件
* Author: purecolor@foxmail.com
* Date : 2011-02-25
* Params:
* defaults:{
currentClass:当前样式,
trigger:触发方式,
callBack:回调函数,
auto:是否自运行,
detay:延迟时间,
index:当前位置
* }
* Return: null
* Note : Tab选项框插件
*
*/
(function($){
$.fn.extend({
tabBuild:function(options){
return $(this).each(function(){
var defaults={
currentClass:"currentOne",
trigger:"mouseover",
callBack:null,
auto:true,
detay:3000,
index:0
}
var params=$.extend(defaults,options);
var $this=$(this);
var items=$('.tab-menu',$this),i=0;
var autoTimer,curro=0;
items.each(function(){
$(this).data('lvl',i);
if(i==params.index){
$('.tab-content',$this).eq(i).show();
$(this).addClass(params.currentClass);
}else{
$('.tab-content',$this).eq(i).hide();
}
i++;
$(this).bind(params.trigger,function(e){
//移除自动运行
if(params.auto){
if(autoTimer) clearInterval(autoTimer);
}
move($(this).data("lvl"));
//清除冒泡
if (e.stopPropagation) {
e.stopPropagation(); // for Mozilla and Opera
}
else if (window.event) {
window.event.cancelBubble = true; // for IE
}
});
});
//移动播放
function move(i){
//移除上一个效果
items.eq(params.index).removeClass(params.currentClass);
$('.tab-content',$this).eq(params.index).hide();
//移至当前位置
items.eq(i).addClass(params.currentClass);
$('.tab-content',$this).eq(i).show();
params.index=i;
}
//自动运行
function auto(){
if(params.auto){
autoTimer=setInterval(function(){
curro=(params.index>=2)?0:(params.index+1);
move(curro);
},params.detay);
}else{
if(autoTimer) clearInterval(autoTimer);
}
}
auto();
});
}
});
})(jQuery);
标签:
jQuery,Tab,选项框
幽灵资源网 Design By www.bzswh.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
幽灵资源网 Design By www.bzswh.com
暂无评论...
P70系列延期,华为新旗舰将在下月发布
3月20日消息,近期博主@数码闲聊站 透露,原定三月份发布的华为新旗舰P70系列延期发布,预计4月份上市。
而博主@定焦数码 爆料,华为的P70系列在定位上已经超过了Mate60,成为了重要的旗舰系列之一。它肩负着重返影像领域顶尖的使命。那么这次P70会带来哪些令人惊艳的创新呢?
根据目前爆料的消息来看,华为P70系列将推出三个版本,其中P70和P70 Pro采用了三角形的摄像头模组设计,而P70 Art则采用了与上一代P60 Art相似的不规则形状设计。这样的外观是否好看见仁见智,但辨识度绝对拉满。