(function(jq){ jq.fn.dropdown = function(settings){ var defaults = { dropdownEl: '.dropdown-menu', openedClass: 'dropdown-open', delayTime: 100 } var opts = jq.extend(defaults, settings); return this.each(function(){ var curObj = null; var preObj = null; var openedTimer = null; var closedTimer = null; jq(this).hover(function(){ if(openedTimer) clearTimeout(openedTimer); curObj = jq(this); openedTimer = setTimeout(function(){ curObj.addClass(opts.openedClass).find(opts.dropdownEl).show(); },opts.delayTime); preObj = curObj; },function(){ if(openedTimer) clearTimeout(openedTimer); openedTimer = setTimeout(function(){ preObj.removeClass(opts.openedClass).find(opts.dropdownEl).hide(); },opts.delayTime); }); jq(this).bind('click', function(){ if(openedTimer) clearTimeout(openedTimer); openedTimer = setTimeout(function(){ preObj.removeClass(opts.openedClass).find(opts.dropdownEl).hide(); },opts.delayTime); }); }); }; })(jQuery); ;(function($){ $.fn.tabso=function( options ){ var opts=$.extend({},$.fn.tabso.defaults,options ); return this.each(function(i){ var _this=$(this); var $menus=_this.children( opts.menuChildSel ); var $container=$( opts.cntSelect ).eq(i); if( !$container) return; if( opts.tabStyle=="move"||opts.tabStyle=="move-fade"||opts.tabStyle=="move-animate" ){ var step=0; if( opts.direction=="left"){ step=$container.children().children( opts.cntChildSel ).outerWidth(true); }else{ step=$container.children().children( opts.cntChildSel ).outerHeight(true); } } if( opts.tabStyle=="move-animate" ){ var animateArgu=new Object(); } $menus[ opts.tabEvent]( function(){ var index=$menus.index( $(this) ); $( this).addClass( opts.onStyle ) .siblings().removeClass( opts.onStyle ); switch( opts.tabStyle ){ case "fade": if( !($container.children( opts.cntChildSel ).eq( index ).is(":animated")) ){ $container.children( opts.cntChildSel ).eq( index ).siblings().css( "display", "none") .end().stop( true, true ).fadeIn( opts.aniSpeed ); } break; case "move": $container.children( opts.cntChildSel ).css(opts.direction,-step*index+"px"); break; case "move-fade": if( $container.children( opts.cntChildSel ).css(opts.direction)==-step*index+"px" ) break; $container.children( opts.cntChildSel ).stop(true).css("opacity",0).css(opts.direction,-step*index+"px").animate( {"opacity":1},opts.aniSpeed ); break; case "move-animate": animateArgu[opts.direction]=-step*index+"px"; $container.children( opts.cntChildSel ).stop(true).animate( animateArgu,opts.aniSpeed,opts.aniMethod ); break; default: $container.children( opts.cntChildSel ).eq( index ).css( "display", "block") .siblings().css( "display","none" ); } }); $menus.eq(0)[ opts.tabEvent ](); }); }; $.fn.tabso.defaults={ cntSelect : ".content_wrap", tabEvent : "mouseover", tabStyle : "normal", direction : "top", aniMethod : "swing", aniSpeed : "fast", onStyle : "current", menuChildSel : "*", cntChildSel : "*" }; })(jQuery); $(document).ready(function($){ $("#normaltab").tabso({ cntSelect:"#normalcon", tabEvent:"mouseover", tabStyle:"normal" }); $("#normaltab2").tabso({ cntSelect:"#normalcon2", tabEvent:"mouseover", tabStyle:"normal" }); $("#normaltab3").tabso({ cntSelect:"#normalcon3", tabEvent:"click", tabStyle:"normal" }); }); // JavaScript Document var Marquee20 = function(id){ try{document.execCommand("BackgroundImageCache", false, true);}catch(e){}; var container = document.getElementById(id), original = container.getElementsByTagName("dl")[0], speed = arguments[1] || 30, clone = original.cloneNode(true); container.appendChild(clone); var rolling = function(){ if(container.scrollTop == clone.offsetTop){ container.scrollTop = 0; }else{ container.scrollTop++; } } var timer = setInterval(rolling,speed)//设置定时器 container.onmouseover=function() {clearInterval(timer)}//鼠标移到marquee上时,清除定时器,停止滚动 container.onmouseout=function() {timer=setInterval(rolling,speed)}//鼠标移开时重设定时器 } window.onload = function(){ //Marquee20("gh1111"); } //导航 $(document).ready(function(){ $(".navbg").capacityFixed(); $("#navul > li").not(".navhome").hover(function(){ $(this).addClass("navmoon"); },function(){ $(this).removeClass("navmoon"); }); }); //选项卡 /*function setTab(name,cursel,n){ for(i=1;i<=n;i++){ var menu=document.getElementById(name+i); var con=document.getElementById("con_"+name+"_"+i); menu.className=i==cursel?"cur":""; con.style.display=i==cursel?"block":"none"; } }*/ function setTab(m,n){ var tli=document.getElementById("menu"+m).getElementsByTagName("div"); var mli=document.getElementById("main"+m).getElementsByTagName("ul"); for(i=0;i