$(function(){ var wh=$(window).height() var ww=$(window).width() $(".back-top").click(function(){ $("html,body").stop().animate({scrolltop: 0}, 800); }); $(window).scroll(function(){ if($(window).scrolltop() < 300){ $(".side-btn a span").hide(); $(".back-top").hide(); }else{ $(".side-btn a span").show(); $(".back-top").show(); } hover($(".back-top"), "hover"); }); }) $(function(){ var wh=$(window).height() var ww=$(window).width() $(".map div img").hover(function(){ $(this).siblings("p").css({"display":"block"}) }) $(".map div img").parent("div").mouseleave(function(){ $(this).find("p").css({"display":"none"}) }) $(".back-top").click(function(){ $("html,body").stop().animate({scrolltop: 0}, 800); }); // $(".side-btn a").hover(function(){ // $(".side-btn a").find("span").show().find("em").stop().animate({left: 0}, 500); // }, function(){ // $(".side-btn a").find("em").stop().animate({left: - 100 + '%'}, 500, function(){ // $(".side-btn a").find("em").css("left", 100 + '%'); // $(".side-btn a").find("span").hide(); // }); // }) $(window).scroll(function(){ if($(window).scrolltop() < 300){ $(".side-btn a span").hide(); $(".back-top").hide(); }else{ $(".side-btn a span").show(); $(".back-top").show(); } hover($(".back-top"), "hover"); }); }) $(window).resize(function(){ slideh(); wwimg(); }).load(function(){ slideh(); wwimg(); }).scroll(function(){ $('#u-rbar .rbar-btn').removeclass('rbar-btnsel'); }); var globalevn = { gload:function(){ // 浮动层 $('#u-rbar').on('click','.btn',function(){ var $thisp = $(this).parent(); $thisp.toggleclass('rbar-btnsel'); }).on('click','.fan',function(){ // 返回顶部 $('html,body').animate({scrolltop:0},1000); }); }, init:function(){ this.gload(); } }; var ie6 = !-[1, ] && !window.xmlhttprequest; //下拉 $.fn.sele = function() { var ev = ($(this).data('sele') ? $(this).data('sele').act : 'mouseenter').split(" "); $(this).bind(ev[0], function() { sele_show(this, ev[0]) }).bind('mouseleave', function() { sele_hide(this) }); function sele_show(me, evt) { $(me).find('.sele_').stop(1, 0).show().children('a').click(function(event) { event.stoppropagation(); if (!$(this).attr('target')) { event.preventdefault(); if ($(me).find('.btn').length) { $(me).find('.btn').attr('href', $(this).attr('href')) }; $(this).parent().hide().parents('.sele').find('span').text($(this).text()); if ($(this).parents('.sele').children('input').length) $(this).parents('.sele').children('input').val($(this).data('val')) } }) }; function sele_hide(me) { $(me).find('.sele_').stop(1, 0).hide() } }; var $sele=$('.sele'); $sele.each(function(i) {$(this).css('z-index',$sele.length-i).sele()}); var $sele = $('.sele'); $sele.each(function(i) { $(this).css('z-index', $sele.length - i).sele() }); $('.nav .nl:even').find('.secnav').css({left:-980}) $('.nav .nl:odd').find('.secnav').css({left:980}) $('.nav .nl:even').hover(function() { $(this).addclass('nl_hover'); $(this).find('.secnav').stop().animate({left:0},1000) }, function() { $(this).removeclass('nl_hover'); $(this).find('.secnav').stop().animate({left:-980},1000) }); $('.nav .nl:odd').hover(function() { $(this).addclass('nl_hover'); $(this).find('.secnav').stop().animate({left:0},1000) }, function() { $(this).removeclass('nl_hover'); $(this).find('.secnav').stop().animate({left:980},1000) }); $('.speciallinks li').hover(function() { $(this).find('h3').stop().animate({ width: 210 }, 160) }, function() { $(this).find('h3').stop().animate({ width: 140 }, 160) }) var catetotal = $('.tab-title a').length, dots = '', swiperlength = $('.swiper .swiper-slide').length; for (var i = 0; i < swiperlength; i++) { dots += '' }; $('.swiper').append(''); var cate = $('.tab-cont').swiper({ speed: 1000, onslidechangestart: function() { cate.activeindex == 0 ? $('.prev').fadeout() : $('.prev').fadein(); cate.activeindex == catetotal - 1 ? $('.next').fadeout() : $('.next').fadein(); $('.tab-title a').eq(cate.activeindex).addclass('current').siblings().removeclass('current') } }); $('.tab-title a').on('click', function() { $(this).addclass('current').siblings().removeclass('current'); cate.swipeto($(this).index()); return false }); $('.prev, .next', '.tab-cont').on('click', function() { $(this).hasclass('prev') ? cate.swipeprev() : cate.swipenext() }); var bannerindex = 0, bannert; function banner() { cleartimeout(bannert); var $slide = $('.swiper .swiper-slide').eq(bannerindex); $slide.fadein(800).siblings().fadeout(function() { $(this).removeclass('current') }); settimeout(function() { $slide.addclass('current') }, 20); $('.pagination span').eq(bannerindex).addclass('swiper-active-switch').siblings().removeclass('swiper-active-switch'); bannerindex = bannerindex + 1 >= swiperlength ? 0 : bannerindex + 1; bannert = settimeout(banner, 3500) }; banner(); $('.pagination span').on('click', function() { bannerindex = $(this).index(); banner(); return false }) /*jiangbei*/ $(".lp").each(function(index, el) { $(this).mouseover(function(event) { $(".jiangbei").eq(index).fadein(100); }).mouseout(function(event) { /* act on the event */ $(".jiangbei").fadeout(100); });; }); //