(function ($) { $(function () { nav(); //顶部导航坐标条 //sideSlider(); //左侧竖导航 }); function nav() { var $liCur = $(".nav-box>ul>li.cur"), curP = $liCur.position() ? $liCur.position().left : 0, curW = $liCur.outerWidth(true), $slider = $(".nav-line"), $targetEle = $(".nav-box>ul>li:not('.last')").find('a'), $navBox = $(".nav-box"); $slider.stop(true, true).animate({ "left" : curP, "width" : curW }); $targetEle.mouseenter(function () { var $_parent = $(this).parent(), _width = $_parent.outerWidth(true), posL = $_parent.position().left; $slider.stop(true, true).animate({ "left" : posL, "width" : _width }, "fast"); }); $navBox.mouseleave(function (cur, wid) { cur = curP; wid = curW; $slider.stop(true, true).animate({ "left" : cur, "width" : wid }, "fast"); }); }; function sideSlider() { if (!$(".help-side dl").length) { return false; } var $aCur = $(".help-side dl").find(".cur a"), $targetA = $(".help-side dl dd a"), $sideSilder = $(".side-slider"), curT = $aCur.position().top+1; $sideSilder.stop(true, true).animate({ "top" : curT }); $targetA.mouseenter(function () { var posT = $(this).position().top+1; $sideSilder.stop(true, true).animate({ "top" : posT }, 240); }).parents(".help-side").mouseleave(function (_curT) { _curT = curT $sideSilder.stop(true, true).animate({ "top" : _curT }); }); }; })(jQuery); //导航开始 (function(){ var time = null; var list = $("#navlist"); var box = $("#navbox"); var lista = list.find("li"); var listb = lista.find("a"); for(var i=0,j=lista.length;i'); $.fn.toggleCheckbox = function () { this.attr('checked', !this.attr('checked')); } $('.check-box').on('click', function () { $(this).find(':checkbox').toggleCheckbox(); $(this).toggleClass('checkedBox'); }); $(document).ready(function($){ $(".offer_5_2_2").css('opacity','0'); $(".offer_5_2 li").hover( function(){$(this).find('.offer_5_2_2').stop().animate({opacity:'1'},300); }, function(){$(this).find('.offer_5_2_2').stop().animate({opacity:'0'},300); } ); $(".index_7_1_2 li").hover( function(){$(this).find('.noe').stop().animate({opacity:'1'},500); }, function(){$(this).find('.noe').stop().animate({opacity:'0'},500); } ); $(".noe").css('opacity','0'); $(".index_9_2").tabso({ cntSelect:".index_9_3_2om", tabEvent:"click", tabStyle:"fade" }); $(".index_9_3_2_1").tabso({ cntSelect:".index_9_3_2_2", tabEvent:"mouseover", tabStyle:"move-animate", direction : "left" }); }); //首页相册展示 ;(function($){ $.fn.DB_gallery=function(options){ var opt={ thumWidth:110, thumGap:8, thumMoveStep:3, moveSpeed:300, fadeSpeed:300, end:'' } $.extend(opt,options); return this.each(function(){ var $this=$(this); var $imgSet=$this.find('.DB_imgSet'); var $imgWin=$imgSet.find('.DB_imgWin'); var $page=$this.find('.DB_page'); var $pageCurrent=$page.find('.DB_current'); var $pageTotal=$page.find('.DB_total'); var $thumSet=$this.find('.DB_thumSet'); var $thumMove=$thumSet.find('.DB_thumMove'); var $thumList=$thumMove.find('li'); var $thumLine=$this.find('.DB_thumLine'); var $nextBtn=$this.find('.DB_nextBtn'); var $prevBtn=$this.find('.DB_prevBtn'); var $nextPageBtn=$this.find('.DB_nextPageBtn'); var $prevPageBtn=$this.find('.DB_prevPageBtn'); var objNum=$thumList.length; var currentObj=0; var fixObj=0; var currentPage=0; var totalPage=Math.floor(objNum/opt.thumMoveStep); var oldImg; init(); function init(){ setInit(); setMouseEvent(); changeImg(); } function setInit(){ $thumMove.append($thumLine.get()) } function setMouseEvent(){ $thumList.bind('click',function(e){ e.preventDefault(); currentObj=$(this).index(); changeImg(); }); $nextBtn.bind('click',function(){ currentObj++; changeImg(); currentPage=Math.floor(currentObj/opt.thumMoveStep); moveThum(); }); $prevBtn.bind('click',function(){ currentObj--; changeImg(); currentPage=Math.floor(currentObj/opt.thumMoveStep); moveThum(); }); $nextPageBtn.bind('click',function(){ currentPage++; moveThum(); }); $prevPageBtn.bind('click',function(){ currentPage--; moveThum(); }); } function moveThum(){ var pos=((opt.thumWidth+opt.thumGap)*opt.thumMoveStep)*currentPage $thumMove.animate({'left':-pos},opt.moveSpeed); setVisibleBtn(); } function setVisibleBtn(){ $prevPageBtn.show(); $nextPageBtn.show(); $prevBtn.show(); $nextBtn.show(); if(currentPage==0)$prevPageBtn.hide(); if(currentPage==totalPage-1)$nextPageBtn.hide(); if(currentObj==0)$prevBtn.hide(); if(currentObj==objNum-1)$nextBtn.hide(); } function changeImg(){ if(oldImg!=null){ $imgWin.css('background','url('+oldImg+') no-repeat'); } var $thum=$thumList.eq(currentObj) var _src=oldImg=$thum.find('a').attr('href'); $imgWin.find('img').hide().attr('src',_src).fadeIn(opt.fadeSpeed); oldImg=_src $thumLine.css({'left':$thum.position().left}) $pageCurrent.text(currentObj+1); $pageTotal.text(objNum); setVisibleBtn(); } }) } })(jQuery) //首页相册展示结束 //导航靠顶部 window.onscroll=function(){ /* var zoom_width = window.innerWidth; if(zoom_width 30){ //$("#pf_nav").show(); $(".float1").addClass('float'); $(".box").css('top','105px'); $(".top_1").css('height','105px'); $(".nav-box .nav-line").css('top','0px'); }else{ //$("#pf_nav").hide(); $(".float1").removeClass('float'); $(".box").css('top','135px'); $(".top_1").css('height','30px'); $(".nav-box .nav-line").css('top','-2px'); } } */ } //导航靠顶部结束 ;(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); //返回顶部 (function($){ var goToTopTime; $.fn.goToTop=function(options){ var opts = $.extend({},$.fn.goToTop.def,options); var $window=$(window); $body = (window.opera) ? (document.compatMode == "CSS1Compat" ? $('html') : $('body')) : $('html,body'); // opera fix //$(this).hide(); var $this=$(this); clearTimeout(goToTopTime); goToTopTime=setTimeout(function(){ var controlLeft; if ($window.width() > opts.pageHeightJg * 2 + opts.pageWidth) { controlLeft = ($window.width() - opts.pageWidth) / 2 + opts.pageWidth + opts.pageWidthJg; }else{ controlLeft = $window.width()- opts.pageWidthJg-$this.width(); } var cssfixedsupport=$.browser.msie && parseFloat($.browser.version) < 7;//判断是否ie6 var controlTop=$window.height() - $this.height()-opts.pageHeightJg; controlTop=cssfixedsupport ? $window.scrollTop() + controlTop : controlTop; var shouldvisible=( $window.scrollTop() >= opts.startline )? true : false; if (shouldvisible){ $this.stop().show(); }else{ $this.stop().hide(); } $this.css({ position: cssfixedsupport ? 'absolute' : 'fixed', top: controlTop, right: opts.pageWidthJg }); },30); $(this).click(function(event){ $body.stop().animate( { scrollTop: $(opts.targetObg).offset().top}, opts.duration); $(this).blur(); event.preventDefault(); event.stopPropagation(); }); }; $.fn.goToTop.def={ pageWidth:window.innerWidth,//页面宽度 pageWidthJg:5,//按钮和页面的间隔距离 pageHeightJg:320,//按钮和页面底部的间隔距离 startline:30,//出现回到顶部按钮的滚动条scrollTop距离 duration:400,//回到顶部的速度时间 targetObg:"body"//目标位置 }; })(jQuery); function setbodyzoom(n){ var bodywidth = 1280; var zoom_width = $(window).width(); if(zoom_width 1?1:zoom_number+n; console.log(zoom_number); $body.css('zoom',zoom_number); } */ } //调用返回顶部 $(function(){ setbodyzoom(0); $('').appendTo("body"); $(".backToTop").goToTop({}); $(window).bind('scroll resize',function(){ $(".backToTop").goToTop({}); }); $(window).bind('resize',function(){ setbodyzoom(0.10); }); });