当前位置:首页 > 网页特效 > 图片特效 >

像TAB选项卡一样的图片切换效果

时间:2014-05-30 08:34 来源:互联网 作者:源码搜藏 收藏 推荐

运行代码 保存代码 复制代码 提示:您可以先修改部分代码再运行,保存代码功能在Firefox下无效。
  • 像TAB选项卡一样的图片切换效果,基于jquery来实现,试试这个图片切换有12345数字一起切换有小图大图一起切换里面有教程和源码,鼠标放上图片左侧的彩条上,右侧的大图片和左侧的文字说明一起切换。
  • <script src="http://www.codefans.net/ajaxjs/jquery-1.9.1.min.js" type="text/javascript"></script>
    <script type="text/javascript">
    $(function(){
    // 图片轮播
    bannerRotate.bannerInit();
    });
    var bannerRotate = {
    _time: 3000,
    _fade: 200,
    _i: 0,
    _interval: null,
    _navId: "#mb-inav",
    _navBox: "#mb-ibox",
    _navTxt: "#mb-itxt",
    bannerShow: function() {
    $(this._navId).find("li a").removeClass("cur");
    $(this._navId).find("li:eq("+this._i+")").find("a").addClass("cur");
     
    $(this._navBox).find("a").fadeOut(this._fade);
    $(this._navBox).find("a:eq("+this._i+")").fadeIn(this._fade);
     
    $(this._navTxt).find("div").hide();
    $(this._navTxt).find("div:eq("+this._i+")").fadeIn(this._fade);
    },
    bannerStart:function() {
    var _this = this;
    _this._interval = setInterval(function() {
    if(_this._i >= 2) {
    _this._i = 0;
    }
    else {
    _this._i++;
    }
    _this.bannerShow();
    }, _this._time);
    },
    bannerInit: function() {
    var _this = this;
    _this.bannerStart();
    $(_this._navId).find("li a").bind("mouseover", function() {
    clearInterval(_this._interval);
    _this._i = $(this).parent().index();
    _this.bannerShow();
    _this.bannerStart();
    });
    }
    };
    </script>
由源码搜藏网整理,转载请注明出处https://www.codesocang.com/tx-pic/8132.html

图片特效下载排行

最新文章