//事件兼容 var xxevents=('ontouchstart' in window)?{start: 'touchstart', move: 'touchstart', end: 'touchend'} : {start: 'click', move: 'mousemove', end: 'mouseup'}; var _xx=_xx||{};//_xx命名空间,_开头的为全局变量 _xx.mainnav=function(a){ //导航操作 //参数a 标示当前高亮的导航 _xx.navindex=a;//记录当前导航 var anav=$('#js-nav > li'), ohdc=$('.header-con'); function flexh($obj,s){ var box=$obj.find('>div'); if(!box[0]) return; if(s==1) box.stop().animate({height:box.find('>div').outerheight()},500); else if(s==0) box.stop().animate({height:0},500); } anav.hover(function(){ flexh($(this),1) },function(){ flexh($(this),0) }); }; $(function(){ $('.footer-map').on('click', function () { $('.full-page').show(); $('.fixed-sitemap').show(); }); $('.btus').on('click', function () { $('.full-page').show(); $('.fixed-law').show(); }); $('.full-page-base').on('click', function () { $('.full-page').hide(); $('.full-fixed-body > div').hide(); }); } ) $(function(){ var obj = $('#js_pulldown .pd_box'); var obtn = $('#js_pulldown'); var h = obj.find('div').outerheight(); var i = 1; obtn.click(function (e) { var e = e || event; if (i) { obj.stop().animate({ height: h }, 500); $(this).addclass('on'); i = 0; } else { obj.stop().animate({ height: 0 }, 300); $(this).removeclass('on'); i = 1; } e.stoppropagation(); }); $(document).click(function () { obj.stop().animate({ height: 0 }, 300); obtn.removeclass('on'); i = 1; }); } ) //$(function(a){ // var b = a(".js_box"), // c = b.find("li.j_item"), // d = function() { // var b = a(window).width(); // return 1200 > b ? !0 : !1 // }; // c.hover(function() { // var b = a(this), // e = d() ? 110 : 120, // f = d() ? 350 : 357; // c.not(b).stop().animate({ // width: e // }).removeclass("on"), b.stop().animate({ // width: f // }).addclass("on") // }), // a(window).resize(function() { // c.filter(".on").mouseenter() // }) // }) $(function(){ var indexnav = $('.nav-right ul .current').index(); $('.nav-right ul li').hover( function(){ $(this).addclass('current').siblings().removeclass('current'); },function(){ $(this).removeclass('current'); $('.nav-right ul li').eq(indexnav).addclass('current'); } ); $('.main').addclass('list_hover'); $('.idea-con').addclass('list_hover'); }) $(function(){ var finfo=$('#pageinfo span a'); finfo.click(function(){ $(this).addclass('current').siblings().removeclass('current'); }) }) $('.ul-li li').on(xxevents.move,function (g) { var tab = $(this), index = $(this).index(), tabcon = $('.news-c .tabcon'); $('.ul-li li').removeclass('avt'); tab.addclass('avt'); tabcon.not(tabcon.eq(index)).slideup(); tabcon.eq(index).slidedown(); g.preventdefault(); }); //$('.js_box li').click(xxevents.move, function (g) { // var tab = $(this), // index = $(this).index(), // tabcon = $('.inner-box'); // tabcon.not(tabcon.eq(index)).slideup(); // tabcon.eq(index).slidedown(); // g.preventdefault(); //}); $('.ul-list li').on(xxevents.move, function (g) { var tab = $(this), index = $(this).index(), tabcon = $('.boxs .boxcon'); tabcon.not(tabcon.eq(index)).slideup(); tabcon.eq(index).slidedown(); g.preventdefault(); }); $('#js-tab li').click(xxevents.move,function (g) { var tabs = $(this), index = $(this).index(), tabcons = $('.g-wrp #js-tabcon'); $('#js-tab li').removeclass('cur'); tabs.addclass('cur'); tabcons.not(tabcons.eq(index)).slideup(); tabcons.eq(index).slidedown(); g.preventdefault(); }); $('.nav-honor span').click(xxevents.move, function (g) { var tabst = $(this), index = $(this).index(), tabconst = $('.honor_a'); $('.nav-honor span').removeclass('honor_avt'); tabst.addclass('honor_avt'); tabconst.not(tabconst.eq(index)).hide(); tabconst.eq(index).show(); g.preventdefault(); }); function indexpage () { $('#index-banner-slides').slidesjs({ width: 1400, height: 600, play: { auto: true, interval: 5000, restartdelay: 2500, effect: "fade" }, navigation: { active: false, effect: "fade" }, pagination: { effect: "fade" }, effect: { fade: { speed: 600 } } }); $('.news-slides').slidesjs({ width: 280, height: 32, play: { auto: true, interval: 10000, restartdelay: 2500, pauseonhover: true, effect: "slide" }, navigation: { active: false, effect: "slide" }, effect: { fade: { speed: 600 } } }); $('.slides-building').slidesjs({ width: 365, height: 100, play: { auto: true, interval: 5000, restartdelay: 2500, effect: "slide" }, navigation: { active: true, effect: "slide" }, effect: { fade: { speed: 600 } } }); }; /* 图片轮换插件 */ jquery.fn.extend({ imgscroll:function(x,nj){ if(nj==undefined) var nj=true; this.each(function(index,docele){ var inow=0,ilast=0,fx=1,timer; var mli=$('.m_ul li',docele); var btnli=$('.b_ul li',docele); var pre=$('.pre',docele); var next=$('.next',docele); var _length=mli.length; mli.eq(0).css({left:0}); btnli.eq(0).addclass('on'); var move=function(){ if(inow=_length) inow=0; if(inow<0) inow=_length-1; btnli.removeclass('on'); btnli.eq(inow).addclass('on'); mli.eq(inow).css({left:x*fx}); mli.eq(inow).stop().animate({left:0},'slow'); mli.eq(ilast).stop().animate({left:1280},'slow'); fx=1; } btnli.click(function(){ ilast=inow; inow=$(this).index(); if(inow!=ilast) move(); }) pre.click(function(){ ilast=inow; inow--; move(); }) next.click(function(){ ilast=inow; inow++; move(); }) if(nj){ timer=setinterval(function(){ ilast=inow; inow++; move(); },2000); $('.pre,.next,ul:last li',docele).hover(function(){ clearinterval(timer); },function(){ clearinterval(timer); timer=setinterval(function(){ ilast=inow; inow++; move(); },2000); }) } }) }, imgalpha:function(){ this.each(function(index,docele){ var inow=0,timer; var m_li=$('.js_move li',docele); var btn_li=$('.js_btn li',docele); var _length=m_li.length; var z=_length; //初始化 btn_li.eq(inow).addclass('bx-avt'); m_li.eq(inow).hide().css('zindex',z).stop().fadein(); var move=function(){ z++; if(inow>_length-1) inow=0; if(inow<0) inow=_length-1; btn_li.removeclass('bx-avt'); btn_li.eq(inow).addclass('bx-avt'); m_li.eq(inow).hide().css('zindex',z).stop().fadein(); } clearinterval(timer); timer=setinterval(function(){ inow++; move(); },2000); btn_li.hover(function(){ clearinterval(timer); inow=$(this).index(); move(); },function(){ clearinterval(timer); timer=setinterval(function(){ inow++; move(); },2000); }); }) } });