(function (window, $, undefined) { /* * tab切换插件 * 用例:$('*').createTab(); */ $.fn.createTab = function (opt) { var def = { activeEvt: 'mouseover', activeCls: 'cur' } $.extend(def, opt); this.each(function () { var $this = $(this); var timer; $this.find('ul.title li').mouseover(def.activeEvt,function(){ var index = $(this).index(), that = $(this); timer = setTimeout(function(){ that.addClass('cur').siblings().removeClass('cur'); $this.find('div.list').animate({marginLeft:-1000*index},'slow'); },300); }).mouseout(function(){ clearTimeout( timer ); }) }); } })(window, jQuery); $(function(){ $(".jyTable").createTab() }) "/>

jQuery课程表选项卡滑动切换代码

198
0
jQuery选项卡滑动选项卡课程表选项卡
这是一款蓝色风格的jQuery课程表选项卡滑动切换代码,以选项卡的方式查看学校机房信息课程表样式。
<script language="javascript">
(function (window, $, undefined) {
    /*
     * tab切换插件
     * 用例:$('*').createTab();
     */
    $.fn.createTab = function (opt) {
        var def = {
            activeEvt: 'mouseover',
            activeCls: 'cur'
        }
        $.extend(def, opt);
        this.each(function () {
            var $this = $(this);
            var timer;
            $this.find('ul.title li').mouseover(def.activeEvt,function(){
                var index = $(this).index(),
                    that = $(this);
                timer = setTimeout(function(){
                    that.addClass('cur').siblings().removeClass('cur');
                    $this.find('div.list').animate({marginLeft:-1000*index},'slow');
                },300);
            }).mouseout(function(){
                clearTimeout( timer );
            })
        });
    }

})(window, jQuery);
$(function(){
    $(".jyTable").createTab()
})
</script>