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, produs = 0, 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"; }; function pageBox() { w_width = jQuery(window).width(); w_height = jQuery(window).height(); //设置移动端参数 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) { ST = $(window).scrollTop(); if ($("body").find('.pwranger').length > 0) { if (ST >= $('.pwranger').outerHeight()) { $('.header-box').addClass('scoll'); } else { $('.header-box').removeClass('scoll'); } } else { if (ST >= 1) { $('.header-box').addClass('scoll'); } else { $('.header-box').removeClass('scoll'); } } $(window).scroll(function () { ST = $(window).scrollTop(); if ($("body").find('.pwranger').length > 0) { if (ST >= $('.pwranger').outerHeight()) { $('.header-box').addClass('scoll'); } else { $('.header-box').removeClass('scoll'); } } else { if (ST >= 1) { $('.header-box').addClass('scoll'); } else { $('.header-box').removeClass('scoll'); } } }); } else { $(".variety,.introducte,.newdynamic,.ptext,.establishs,.brand-info,.res-wrap,.inherit-info").removeClass('article-block'); } } pageBox(); jQuery(window).resize(function () { pageBox(); }); $(window).load(function () { $('.menuBtn').bind('click', function () { $(this).toggleClass('active'); $('.menu-mark').toggleClass('on'); $('.menu-fix').fadeToggle(); }); $(".menu-list li").each(function (index) { $(this).css({ 'animation-delay': (index / 10) + 's' }); }); }); $('.online-book').hover(function () { $('.reservate').fadeToggle(); }); var Spam = ""; var text = ""; $('.select b').click(function (e) { e.stopPropagation(); $(this).parents('.select').find('ul').stop(true, true).slideToggle(); }); $('.select-down li').click(function (e) { e.stopPropagation(); text = $(this).text(); $(this).parents('.select').find('b').text(text); $(this).parents('.select').find('ul').stop(true, true).slideToggle(); }); $(document).on('click', function (e) { e.stopPropagation(); $(".select-down").slideUp(); }); $('.backtop').click(function () { jQuery("html,body").animate({ scrollTop: 0 }, 1200, 'easeInOutExpo'); }) jQuery(window).scroll(function () { var windowTop = jQuery(window).scrollTop(); if (windowTop < w_height && !isMobile) { jQuery('.pbanner img').css('transform', "translate(0px," + (windowTop) / 1.5 + "px)"); }; }); $(".menu-list li").each(function (index) { $(this).css({ 'animation-delay': (index / 8) + 's' }); }); setPopUp($('.attente a'), "官网微信"); 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 () { var ul = $("#navs"), li = $("#navs li"), i = li.length, n = i - 1.2, r = 150; ul.click(function () { $(this).toggleClass('active'); if ($(this).hasClass('active')) { for (var a = 0; a < i; a++) { li.eq(a).css({ 'transition-delay': "" + (50 * a) + "ms", '-webkit-transition-delay': "" + (50 * a) + "ms", '-o-transition-delay': "" + (50 * a) + "ms", 'transform': "translate(" + (-r * Math.cos(90 / n * a * (Math.PI / 180))) + "px," + (-r * Math.sin(90 / n * a * (Math.PI / 180))) + "px", '-webkit-transform': "translate(" + (-r * Math.cos(90 / n * a * (Math.PI / 180))) + "px," + (-r * Math.sin(90 / n * a * (Math.PI / 180))) + "px", '-o-transform': "translate(" + (-r * Math.cos(90 / n * a * (Math.PI / 180))) + "px," + (-r * Math.sin(90 / n * a * (Math.PI / 180))) + "px", '-ms-transform': "translate(" + (-r * Math.cos(90 / n * a * (Math.PI / 180))) + "px," + (-r * Math.sin(90 / n * a * (Math.PI / 180))) + "px" }); } } else { li.removeAttr('style'); } }); })($);