锘?/ JavaScript Document $(document).ready(function () { var isSupportTouch = !!('ontouchend' in document) || navigator.userAgent.indexOf('Windows Phone') > 0; $('input').placeholder(); $('textarea').placeholder(); //--------------pc绔鑸 if($(window).width() > 1024){ $(".header .nav li").hover(function () { $(this).addClass("hover") }, function () { $(this).removeClass("hover") }) }else if($(window).width() <= 1024 && $(window).width() > 768){ $(".nav > li").each(function(i){ if(i!=0){ $(".nav > li:eq("+i+") > a").attr("href","javascript:void(0)"); } }) $(".header .nav li").click(function () { if($(this).hasClass("hover")){ $(this).removeClass("hover") }else{ $(this).addClass("hover") $(this).siblings().removeClass("hover"); } }) } // //--------------鎵嬫満瀵艰埅 $(document).on("click", ".menu_h,.ph-mask", function () { //$(this).parents("body").toggleClass("menu-open"); if($('body').hasClass('menu-open')){ $('body').removeClass('menu-open'); $('html,body').removeAttr('style'); }else{ $('body').addClass('menu-open'); $('html,body').css({height:$(window).height(),overflow:'hidden'}); } }); //--------------pad瀵艰埅鐐瑰嚮 /*if ($(window).width() > 767 && $(window).width() < 1205) { $(".header .nav li > a").click(function (e) { if ($(this).parent().hasClass("on")) { //return false; } else { e.preventDefault(); e.stopPropagation(); $(this).parent().siblings().removeClass("on").end().addClass ("on"); } }); }*/ // //寰俊寮圭獥 $(".wechat").click(function () { var url = $(this).attr("data-img"); //alert(url) var title = ""; title += "
"; title += "x"; title += "

浜岀淮鐮?/h2>"; title += "
" title += "

鎵竴鎵?/p>"; title += "

"; $("body").remove(".weixin"); $("body").append(title); //var op="http://service.weibo.com/share/share.php?url='"+ url +"'&title='"+ title +"'&searchPic=false" //window.open(op) }); $(document).on("click", ".weixin .c", function () { //alert(0) $(".weixin").remove(); }); //--------------鍏敤閫夐」鍗″垏鎹 $(document).on("click", ".tab-box .tab-a", function () { $(this).addClass("on").siblings().removeClass("on"); var ii=$(this).index(); $(this).parents(".tab-box").find(".tab-b").eq(ii).show().siblings().hide(); }); // $(".tab-box").each(function (i) { $(this).find(".tab-a:eq(0)").click(); if($(window).width()<=1024 & isSupportTouch) { $(this).find(".tab-a a").attr({"href":"javascript:;"}) } }); //end //--------------妯℃嫙涓嬫媺 $(document).on("click", ".select-box dt a", function (e) { e.preventDefault(); e.stopPropagation(); if ($(this).parents(".disabled").hasClass("disabled")) { return false; } $(".select-body-box,.selectmask").remove(); var el = $(this).parents(".select-box"); el.addClass("open"); var ht = el.find("dd").html(), oftop = el.offset().top + el.height(), ofleft = el.offset().left, ofwidth = el.width(); if ($(window).width() < 767) { $("body").append("
" + ht + "
"); oftop = ($(window).height() - $(".select-body-box").height()) / 2; $(".select-body-box").css({ top: oftop }); } else { $("body").append("
" + ht + "
"); } }); $(document).on("click", ".select-body-box a", function (e) { var inde = $(this).index(); $(this).addClass("on").siblings().removeClass("on"); var el = $(".select-box.open"); el.next(".select-hidden").val($(this).attr("data-val")) el.find("dt a b").text($(this).text()); el.find("dd a").eq(inde).addClass("on").siblings().removeClass("on"); setTimeout(function () {//鍏朵粬鏂规硶鍒ゆ柇open鐨勫欢杩燂紱 el.removeClass("open"); },1); $(".select-body-box,.selectmask").remove(); }); $(document).click(function () { $(".select-box.open").removeClass("open"); $(".select-body-box,.selectmask").remove(); }); //end //鐧惧彾绐楀垏鎹 var getHome4_width=0; $(window).resize(function(){ $(".home04_main li img").css({ "width": $(".home04_main").width() * 3/8, "height": $(".main").width() * 3/8 * 0.7587 }); $(".home04_box").width($(".home04_main").width()*0.5*0.6); getHome4_width=Math.floor($(".home04_main").width()/8); $(".home04_main li").width(getHome4_width); $(".home04_main li.on").width(getHome4_width*3-2); }); $(window).resize(); $(".home04_main li").click(function () { if (!$(".home04_main li").is(":animated")) { $(this).stop().animate({ "width": getHome4_width*3-2 }); $(this).siblings().stop().animate({ "width": getHome4_width }); $(this).find(".home04_box").fadeIn(); $(this).siblings().find(".home04_box").fadeOut(); $(this).find("h5").fadeOut(); $(this).siblings().find("h5").fadeIn(); $(this).addClass('on').siblings().removeClass('on'); } }) }); //--------------澶撮儴婊氬姩 $(function () { var headt = $(".header").height(); $(".main").css({ paddingTop: headt }) if ($(window).width() > 1024) { if ($("html").hasClass(".ie7") || $("html").hasClass(".ie8") || $("html").hasClass(".ie9")) { } else { $(window).scroll(function () { var _hScroll = $(window).scrollTop(); if (_hScroll > 0) { $("body").addClass("headerNav"); var headt1 = $(".headerNav .head_nav").height(); $(".main").css({ paddingTop: headt }); //console.log(headt1+","+$(window).scrollTop()); $('.header .top-list').hide(); } else { $("body").removeClass("headerNav"); $(".main").animate({ paddingTop: 131 },function(){ $('.header .top-list').show(); }); //console.log(headt); } }) } } else{ $('.top-list').hide() } }); //end $(function (){ if ($(".lun01 ul li").size() > 1) { $(".lun01 ul").bxSlider({ auto:true, speed:1000 }) } if ($(".in_banner li").size() <= 1) { $(".bx-controls-direction").hide(); $(".bx-default-pager").hide(); }else { $(".bx-default-pager").show(); $(".bxslider").bxSlider({ auto:false, controls:true }); } }); //鏃犲浘鍥惧儚 var nullimg = '../images/error_ab.jpg'; function lod(t) { t.onerror = null; t.src = nullimg } $(document).ready(function () { $("img").each(function () { if ($(this).attr("src") == "") { $(this).attr({ "src": nullimg }) } }) }) // $(function(){ // 鏂伴椈杞挱 var slideIndex=0 var slideLength=$('.slidenews .slidebox li').length var slideTime var slideHeight=$('.slidenews .slidebox').height() $('.slidenews .slidebox ul').css('top',-slideHeight+'px') if ($('.slidenews .slidebox li').length>1) { slideTime=setInterval(function(){ slideIndex++ slideAnimat() },3000) } else{ $('.slidenews a.prev').fadeOut(0); $('.slidenews a.next').fadeOut(0); } $('.slidenews .slidebox li:last-child').clone().prependTo($('.slidenews .slidebox ul')) $('.slidenews .slidebox li').eq(1).clone().appendTo($('.slidenews .slidebox ul')) function slideAnimat(){ if (slideIndexslideLength-1) { if (!$('.slidenews .slidebox ul').is(':animated')) { $('.slidenews .slidebox ul').animate({'top':-(slideIndex+1)*slideHeight},300,function(){ $('.slidenews .slidebox ul').css({'top':-slideHeight+'px'}) slideIndex=0 console.log(slideIndex) }) } } } $('.slidenews a.prev').click(function() { clearInterval(slideTime) slideIndex-- slideAnimat() }); $('.slidenews a.next').click(function() { clearInterval(slideTime) slideIndex++ slideAnimat() }); }) $(function(){ $(".edit_con_original img").parent("p").addClass("imgcur") footerLink(); }) function footerLink(){ $('.foot_ll ul li select').on('change',function(){ var url=$(this).val(); window.open(url) }) }