$(function() { var num; $('.nav-main>li[id]').hover(function () { /*ͼ��������ת*/ // $(this).children().removeclass().addclass('hover-up'); /*���������*/ var obj = $(this).attr('id'); num = obj.substring(3, obj.length); $('#box-' + num).slidedown(300); }, function () { /*ͼ��������ת*/ //$(this).children().removeclass().addclass('hover-down'); /*��������ʧ*/ $('#box-' + num).hide(); }); // hidden-box hover e $('.hidden-box').hover(function () { /*����ͼ������*/ // $('#li-' + num).children().removeclass().addclass('hover-up'); $(this).show(); }, function () { $(this).slideup(200); // $('#li-' + num).children().removeclass().addclass('hover-down'); }); $('.search input').bind('focus',function(){ $(this).parent().addclass("hover"); }); $('.search input').bind('blur',function(){ $(this).parent().removeclass("hover"); }); $('.input').bind('focus',function(){ $(this).addclass("hover"); }); $('.input').bind('blur',function(){ $(this).removeclass("hover"); }); $('.form input').bind('focus',function(){ if($(this).val()==""){ $(this).next("label").hide(); } }); $('.form input').bind('blur',function(){ if(!$(this).val()){ $(this).next("label").show(); } }); $(".mobile-link").click(function(){ layer.open({ type: 1, title:false, skin: 'layui-layer-demo', closebtn: 1, area: ['300px', '300px'], anim: 2, shadeclose: true, content: $('.mobile-qr') }); return false; }) /* $(window).scroll(function () { w_height = $(window).height(); if (jquery(window).scrolltop() < w_height-60 ) { jquery('.page-banner .image').css('margin-top', $(window).scrolltop() / 2); } }); */ jquery('.page-banner').addclass("hover"); var nav = $(".nav ul"), loc = location.href, links = nav.find("a"), link = null, tag = 0, width = 0, left = 0, indicator = $("
  • "); if (tag === 0) { //init(links.eq(0)); } function init(link) { width = link.width()-34; left = link.offset().left - ($(window).width()-$(".wrapper").width())/2 -$(".wrapper").width()+$('.nav').width() + 17; nav.append(indicator.css("left", left) .css({"width":width, "left":left}, 500, function() { //links.hover(hoveron, hoverout); })); } function hoveron() { link = $(".nav .hover a"); control(link.width()-34, link.offset().left - ($(window).width()-$(".wrapper").width())/2 - $(".wrapper").width()+$('.nav').width() + 17); } function hoverout() { control(width, left); } function control(width, left) { indicator.stop().css({"width":width, "left":left}, 300); } //init($(".nav .current a")); $(".nav li").hover(function(){ $(this).siblings().removeclass('hover'); $(this).addclass('hover'); hoveron(); },function(){ $(this).removeclass('hover'); hoverout(); }) $(".index-members .bx-wrapper").hover(function(){ $(this).find(".bx-controls-direction").fadein(300); },function(){ $(this).find(".bx-controls-direction").fadeout(200); }) $("a.tab").hover(function () { $(this).parent().find("a.current").removeclass("current"); $(this).addclass("current"); for(var i=0;i<$(this).parent().find("a").length;i++){ $("#"+$(this).parent().find("a:eq("+i+")").attr("rel")).hide(); } $("#"+$(this).attr("rel")).show(); return false; }); $("a.tabs").click(function () { $(this).parent().find("a.current").removeclass("current"); $(this).addclass("current"); for(var i=0;i<$(this).parent().find("a").length;i++){ $("#"+$(this).parent().find("a:eq("+i+")").attr("rel")).hide(); } $("#"+$(this).attr("rel")).show(); return false; }); //����ѡ� $(document).ready(function () { function tab(i) { $(i).children().click(function () { //������ʽ//click//mouseover $(this).siblings().removeclass(); $(this).addclass('current'); $(this).parent().siblings('.tab-box').hide(); $(this).parent().siblings('.tab-box').eq($(this).index()).show(); $('.tab-line').animate({ left: $(this).position().left}); }) } //tab���� $(function () { tab('.tab1') tab('.tab2');; }) }); var win = $(window); (function() { var banner = $('#banner'), pic_c = banner.find('.pics'), pics = pic_c.children(), idx_c = banner.find('.idxs'), idxs = idx_c.children(), btns = banner.find('.btns a'), prev = btns.filter('.prev'), next = btns.filter('.next'), len = pics.length, idx = 0, prev_i = -1, max_i = len - 1, curr_p = pics.eq(idx), curr_i = idxs.eq(idx), delay = 5000, timeout = -1; win.on('load', function() { idx_recu(0, 1500/len, function() { settimeout(function() { curr_i.addclass('on'); auto(); }, 200); idxs.click(hover); }); banner.hover(function() { // prev.stop().fadein(300); // next.stop().fadein(300); btns.addclass('on'); }, function() { btns.removeclass('on'); // prev.stop().fadeout(300); // next.stop().fadeout(300); }); prev.on('click', function() {fade(idx===0? idx=max_i:--idx)}); next.on('click', function() {fade(idx===max_i? idx=0:++idx)}); }); function fade(idx) { cleartimeout(timeout); prev_i = idx; curr_p.stop(false,true).fadeout(300); curr_p = pics.eq(idx).stop(false,true).fadein(300); curr_i.removeclass('on'); curr_i = idxs.eq(idx).addclass('on'); auto(); } function hover(){ idx = $(this).index(); if (idx === prev_i) return; fade(idx); } function idx_recu(idx, delay, func) { temp = idxs.eq(idx); if (temp.length) { temp.css('margin-top',0).fadein(500); settimeout(function() { idx_recu(idx+1, delay, func); }, delay); } else { func(); return; } } function auto() { timeout = settimeout(function() { fade(idx===max_i? idx=0: ++idx); }, delay); } }()); settimeout(function(){ if($('#follow-btn').length>0){ $('#follow-btn').css("bottom","90px"); } },1000); $(".back-top").click(function(){ $('html,body').animate({scrolltop: '0px'}, 400); return false; }) }); var tur = true; function haha(){ t = $(document).scrolltop(); if(t > 100){ //$('#follow-btn').css("bottom","106px"); }else{ //$('#follow-btn').css("bottom","-200px"); } tur = true; } window.onscroll = function(){ if(tur){ settimeout(haha,1); tur = false; }else{ } } $(function(){ win = $(window); //shownav() //innav(); // �������� function innav(){ $('.nav ul li dl').addclass("sub-nav"); var li = $('.nav ul li'), sideli = $('.sub-nav'), innavbg = $('.innavbg'); li.hover(function(){ index = $(this).index(); $(this).find(sideli).stop(false,true).fadein(); inshow(index); },function(){ $(this).find(sideli).stop(false,true).fadeout(); }); function inshow(index){ if (index > 0 && index < 6) { innavbg.css("height","56px"); } else { innavbg.css("height","0px"); }; }; $('body,.innavbg').mouseleave(function(){ innavbg.css("height","0px"); }); $('.banner-wrapper').mouseover(function(){ innavbg.css("height","0px"); }); }; })