var isTouch = Modernizr.touch, isMobile = false,//区分移动端与PC端 mobile = false,//区分手机端与平板 w_width = 0, w_height = 0, bannerImgh=638, navItem = 0, h_height=0, roll=0, sTop=150, ST = 0; var _mousemove; var _click; var _mousedown; var _mouseup; //移动端事件和PC事件的切换 if (Modernizr.touch) { _mousemove = "touchmove"; _click = "touchend"; _mousedown = "touchstart"; _mouseup = "touchend"; } else { _mousemove = "mousemove"; _click = "click"; _mousedown = "mousedown"; _mouseup = "mouseup"; }; $(".asilder-list").bxSlider({ mode:"fade", speed:3000, auto:true, pager:false, controls:false }); function pageBox() { w_width = jQuery(window).width(); w_height = jQuery(window).height(); h_height = jQuery('.header-box').height(); setImgMax($('.bannerBox .pbimg'), 1920, 849, w_width, w_height); scolltop=$('.scolltop').outerHeight(); //设置移动端参数 if (w_width <= 1024) { isMobile = true; } else if (w_width > 1024) { isMobile = false; }; //区分手机端和平板 if (w_width <= 640) { mobile = true; } else if (w_width > 640) { mobile = false; }; if(!isMobile){ $('.asilder-list li').css('width',w_width); var imgh=$('.asilder-list li').height(); $('.asiderbanner .bx-wrapper').height(imgh); ST = $(window).scrollTop(); $('.mobile-menu').css('display','none'); $('.menuBtn').removeClass('active'); roll=$('.header-box').outerHeight()+$('.asiderbanner').height(); if(ST>=roll){ $('.innernav').addClass('roll'); }else{ $('.innernav').removeClass('roll'); } $(window).scroll(function(){ ST = $(window).scrollTop(); roll=$('.header-box').outerHeight()+$('.asiderbanner').outerHeight(); if(ST>=roll){ $('.innernav').addClass('roll'); }else{ $('.innernav').removeClass('roll'); } }); }else{ $('.mobile-menu').outerHeight(w_height-h_height); $('.distribution').removeClass('article-block'); }; }; pageBox(); jQuery(window).resize(function () { pageBox(); }); $('.honors').owlCarousel({ items:4, slideSpeed:1000, navigation: true, pagination: false, controls:true, itemsDesktop: [1199, 3], itemsDesktopSmall: [1024, 2], itemsTablet: [860, 2], itemsTabletSmall: false, itemsMobile: [480, 1] }); $('.knowledges').owlCarousel({ items:3, slideSpeed:1000, navigation: true, pagination: false, controls:true, itemsDesktop: [1199, 3], itemsDesktopSmall: [1024, 2], itemsTablet: [860, 2], itemsTabletSmall: false, itemsMobile: [640, 1] }); $(".nav-list >li").mouseover(function () { $(".nav-list >li").removeClass("curret"); $(this).addClass("curret"); if ($(this).index() == 0) { $(".mune-bg").stop(false, false).slideUp(); return; } $(".mune-bg").stop(false,false).slideDown(); $(".mune-bg .leval-menu").stop(false,false).css({left:"39.5%"}) .eq($(this).index()-1).stop(false,false).css({left:"36.5%"}).fadeIn().siblings().hide(); }); $(".header-box").mouseleave(function(){ $(".nav-list >li").removeClass("cur"); $(".mune-bg").stop(false,false).slideUp(); }); $('.menuBtn').bind('click',function (){ $(this).toggleClass('active'); $('.mobile-menu').stop(false,false).slideToggle(); $('.menus').hide(); }); jQuery(function(){ jQuery(".menu-list >li>a").bind("click", function (e) { var $navMobile=jQuery(".mobile-menu"), $navA=$navMobile.find(".menu-list >li >a"), $mSubnav=$navMobile.find(".menus"); var hjcur = $(this); var hjDD = $(this).parents("li"); if (hjDD.find(".menus").size() > 0) { if (hjcur.hasClass("cur")) { $navMobile.slideUp(); hjDD.find(".menus").stop(false, false).slideUp(); hjcur.removeClass("cur"); $navMobile.slideUp(); } else { $navA.removeClass("cur"); $mSubnav.stop(false, false).slideUp(); hjDD.find(".menus").stop(false, false).slideDown(); hjcur.addClass("cur"); e.preventDefault(); } } }); }); $('.property-tab ul').owlCarousel({ items: 5, navigation: true, navigationText:[,], pagination: false, slideSpeed: 1000, itemsDesktop: [1280, 4], itemsDesktop: [1199, 4], itemsDesktopSmall: [1024, 4], itemsTablet: [860, 3], itemsTabletSmall: false, itemsMobile: [640, 1] }); $('.support-list').owlCarousel({ items: 7, navigation: true, navigationText:[,], pagination: false, slideSpeed: 1000, itemsDesktop: [1199, 6], itemsDesktopSmall: [1024, 5], itemsTablet: [730, 3], itemsTabletSmall: false, itemsMobile: [480,2] }); jQuery('.recommend-list li figcaption .hotproduct span,.appoint-info:nth-child(2) a').click(function(e){ e.preventDefault(); $('.purchase').fadeIn('slow'); }); jQuery(".process-list li").each(function(i,o){ $(this).css({"transition":"600ms "+(i*200+400)+"ms","-webkit-transition":"600ms "+(i*200+400)+"ms"}); }); jQuery(".service-list li").each(function(i,o){ $(this).css({"transition":"600ms "+(i*200+400)+"ms","-webkit-transition":"600ms "+(i*200+400)+"ms"}); }); jQuery(".line-list li").each(function(i,o){ $(this).css({"transition":"600ms "+(i*200+400)+"ms","-webkit-transition":"600ms "+(i*200+400)+"ms"}); }); jQuery('.closed').click(function(){ $('.purchase').fadeOut('slow'); }); (function(){ var timer2=null; var now=$('.historys li').first().index(); var ol=$('.historys li').outerHeight(true); $('.historys li:nth-child(1)').addClass('on'); var wids=$('.historys').outerHeight(ol*($('.historys li').length-1)+$('.historys li:nth-child(1)').outerHeight(true)); $('.history-list i.prev').click(function(){ Imgright1(); }); $('.history-list i.next').click(function(){ ImgLeft1(); }); function ImgLeft1(){ if($('.historys li').length>4){ $('.historys li:nth-child(2)').addClass('on').siblings().removeClass('on'); $('.historys li:first').stop().animate({'marginTop':-ol},function(){$(this).detach().appendTo('.historys').css('margin-top',0) }); } } function Imgright1(){ $('.historys li:last').stop().css('margin-top',-ol).detach().prependTo('.historys').animate({marginTop:0}); $('.historys li:nth-child(1)').addClass('on').siblings().removeClass('on'); } $('.historys li').click(function(){ $(this).addClass('on').siblings().removeClass('on'); }); })(); $('.innernav-list li a').click(function(){ $(this).addClass('on').parent().siblings('li').find('a').removeClass('on'); }); $('.recuit-top').click(function(){ $(this).toggleClass('on'); $(this).parents('li').siblings().find('.reruit-info').slideUp(); $(this).parents('li').siblings().find('.recuit-top').removeClass('on'); $(this).next('.reruit-info').slideToggle(); }); jQuery(".leval-menu li a,.menus li a,.innernav-list li a").click(function(e){ var hash=jQuery(this).attr("href").split("#")[1]; if(hash && jQuery("#"+hash).length==1){ e.preventDefault(); setScroll("#"+hash); $(".menuBtn").removeClass("active"); $('.mobile-menu').slideUp(); } }); function getHash(){ var hash = location.href.split("#")[1]; if(hash){ setScroll("#"+hash); } }; var scnum=76; function setScroll(anchorCur){ if(isMobile){ scnum=68; }else{ scnum=76; } jQuery("html,body").delay(300).animate({ scrollTop: jQuery(anchorCur).offset().top-scnum},800,'easeInOutExpo'); }; $(document).ready(function() { var hash = location.href.split("#")[1]; if(hash){ $('.innernav-list').onePageNav({ filter: ':not(.external)', }); } }); function cenyer(){ $('.knowledge-list').each(function() { var hei=$(this).find('.brand-list li figure img,.knowledges li figure img').height(); $(this).find('.owl-theme .owl-controls .owl-buttons .owl-prev,.owl-theme .owl-controls .owl-buttons .owl-next').css({'top':hei/2,'margin-top':-20}) }); } cenyer(); jQuery(window).resize(function () { cenyer(); }); $('.room-list li').hover(function(e) { $(this).find('.mark').stop().fadeToggle(); }); $('.support-list .owl-item').eq(0).addClass('on'); $('.support-list .owl-item').click(function(){ var index_=$(this).index(); $(this).addClass('on').siblings().removeClass('on'); $('.support-text .support-info').eq(index_).slideDown().siblings().slideUp(); }) ; setPopUp($('.weixin'), "官方微信"); function setPopUp(obj, title) { obj.click(function () { var str = '
'; $("body").append(str); jQuery(".popUpblack").fadeIn(); jQuery(".popUp").animate({marginTop:"-127"},400); $(".popUp .close").click(function () { $(".popUpblack").remove(); }); jQuery(".popUpblack").click(function(){$(".popUpblack").remove();}); return false; }); }; function setImgMax(img, imgW, imgH, tW, tH) { var tWidth = tW || w_width; var tHeight = tH || w_height; var coe = imgH / imgW; var coe2 = tHeight / tWidth; if (coe < coe2) { var imgWidth = tHeight / coe; img.css({ height: tHeight, width: imgWidth, left: -(imgWidth - tWidth) / 2, top: 0 }); } else { var imgHeight = tWidth * coe; img.css({ height: imgHeight, width: tWidth, left: 0, top: -(imgHeight - tHeight) / 2 }); }; };