$(function(){ navBarOption.init(); carousel.init(); footer.init(); }); //导航条内容加载 var navBarOption={ menuToggleClick:function(){ var flag1=true; $(".nav_header .menu_toggle").click(function(){ var li=null; var width=$(window).width(); var height=$(window).height(); if(width>399){ if(flag1){ $(".menu_toggle_dropDown_con").css({"height":height+"px"}); $("body").css("-webkit-transform","translate3d(-200px, 0, 0)"); $(".menu_toggle_dropDown_con").show(); flag1=false; }else{ $("body").css("-webkit-transform","translate3d(0, 0, 0)").on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function() { //alert("回调已经启用"); $(".menu_toggle_dropDown_con").hide(); $("body").unbind("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd"); }); flag1=true; } }else{ if(flag1){ $(".menu_toggle_dropDown_con").css("display","block"); setTimeout(function(){ $(".menu_toggle_dropDown_con").css({"height":height+"px","-webkit-transform":"translate3d(0px, 0, 0)"}); flag1=false; },50); }else{ $(".menu_toggle_dropDown_con").css({"-webkit-transform":"translate3d("+width+"px, 0, 0)"}).on('transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd', function() { $(".menu_toggle_dropDown_con").css("display","none"); $(".menu_toggle_dropDown_con").unbind("transitionend webkitTransitionEnd oTransitionEnd otransitionend MSTransitionEnd"); flag1=true; }); } } $(".menu_toggle_dropDown_con .navItemToggle").each(function(x){ if(x==0 || x==4 || x==5 || x==10){} else{ //$(this).find(".menu_toggle_dropDown_con_menu").css({"height":0,"overflow":"hidden","transition":"height 1s"}); if($(this).find("span").html()==$(".main .breadMenu .bread2").html()){ $(this).find(".menu_toggle_dropDown_con_menu").css({"height":$(this).find("li").eq(0).height()*$(this).find("li").length}); $($(this).find(".menu_toggle_dropDown_con_menu li")).each(function(){ if($(this).find("a").html()==$(".main .breadMenu .bread3").html().replace(/[\s]+/g,"")){ $(this).find("a").css("color","#2c95db"); } }); } $(this).click(function(){ var flag=true; if(flag){ $(this).find(".menu_toggle_dropDown_con_menu").css({"height":$(this).find("li").eq(0).height()*$(this).find("li").length}); $(this).siblings().find(".menu_toggle_dropDown_con_menu").css({"height":"0px"}); flag=false; }else{ $(this).find(".menu_toggle_dropDown_con_menu").css({"height":"0px"}); flag=true; } }); } }); $(".li_globel").hover(function(){ $("header .head_top_right .arr").show(); $("header .head_top_right .globel").show(); },function(){ $("header .head_top_right .arr").hide(); $("header .head_top_right .globel").hide(); }); }); }, init:function(){ this.menuToggleClick(); $(".menu_toggle_dropDown_con_menu").css({"height":0,"overflow":"hidden","transition":"height 0.7s"}); $("header .nav_header .menu_toggle_dropDown_con_menu").css("display","block"); $(".menu_toggle_dropDown_con").css({"transform":"translate3d("+$(window).width()+"px, 0, 0)","transition":"-webkit-transform 1s ease","height":$("header").height()+$(".main").height()+$("footer").height()}); } }; var carousel= { bianliang: {"src": ["assets/images/lunboImg/c1.png", "assets/images/lunboImg/c2.png", "assets/images/lunboImg/c3.png"],"src2":["assets/images/lunboImg/carousel1_1.png","assets/images/lunboImg/carousel2_2.png","assets/images/lunboImg/carousel3_3.png"]}, carouselOption:function(){ var div=$("
"); var ul=$(""); div.append(ul); for(var i=0;i"); var img=$(""); li.append(img); ul.append(li); } $(".responsiveImgPlay").append(div); }, start:function(){ $('#slider-box').touchSlider({ box: '#slider-box', arrow: false, auto: true, autoTime: 4000 }); }, contentHover:function(){ $("article .content li").each(function(){ var cover=$("
"); $(this).append(cover); $(this).find("article .content .con span").css({"width":"236px","top":"154px","display":"block","left":0}); }); }, init: function () { this.carouselOption(); this.start(); this.contentHover(); } }; var footer={ addClick:function(){ var flag=true; if($(window).width()>806){ }else{ $("footer .item_tit").css("height", $("footer .item_tit").find("span").height()); } $("footer .item_add").each(function(x){ $(this).click(function(){ if(flag){ $(this).parent().css({"height":26*($(this).siblings(".item").length)+20}); flag=false; }else { $(this).parent().css({"height":$(this).siblings("span").height()}); flag=true; } }); }); }, news:function(){ $(".footer-content .newsList .news_word").each(function(){ var span=$(""); span.html("...."); if($(this).width()>295){ $(this).css("width","295px"); $(this).parent().append(span); } }); $(".footer-content .news .news_content .summary .summary_content .con").each(function(){ var span=$(""); span.html("...."); if($(this).width()>295){ $(this).css("width","295px"); $(this).parent().append(span); } }); if($(window).width()<878){ $(".footer-content .news .news_content .summary .summary_content").width($(".footer-content .news .news_content .summary").width()-105); $(".footer-content .newsList .news_word").width($(".footer-content .news .news_content .summary").width()-105); }else{ $(".footer-content .news .news_content .summary .summary_content").width("260px"); $(".footer-content .newsList .news_word").width("295px"); } $(window).resize(function(){ if($(this).width()<878){ $(".footer-content .news .news_content .summary .summary_content").width($(".footer-content .news .news_content .summary").width()-105); $(".footer-content .newsList .news_word").width($(".footer-content .news .news_content .summary").width()-105); }else{ $(".footer-content .news .news_content .summary .summary_content").width("260px"); $(".footer-content .newsList .news_word").width("295px"); } }); }, init:function(){ this.addClick(); this.news(); } };