// js document $(function() { //禁止右击 // $(document).bind("contextmenu", function (e) { // return false; // }); var $window = $(window); var $ww = $window.width(); var $wh = $window.height(); var i = false; // var $banner = $('.header'); // // $banner.height($wh - 100); // if ($ww < 768) { // // $banner.height(400); // // i = false; // // $('.nav-top-l').hide(); // // } // // else { // // $('.nav-top-l').show(); // // $banner.height($wh - 100); // // } $(window).resize(function() { var $window = $(window); var $ww = $window.width(); if ($ww < 768) { i = false; $('.nav-top-l').hide(); $banner.height(400); } else { $('.nav-top-l').show(); $banner.height($wh - 150); } }) $('.menu_nav').click(function() { if (i = !i) { $('.nav-top-l').slideDown(); } else { $('.nav-top-l').slideUp(); } }) $("#QQ_s").hover( function() { $(".QQ_y").hide(); $(".QQ_x").show(); }, function() { $(".QQ_y").show(); $(".QQ_x").hide(); } ) scroll(function(x) { var scorolltop = $(document).scrollTop(); if (scorolltop == 0) { $('.navbar').removeClass('fixed'); //$('.logo img').attr('src','images/logo.png'); } if (x == "down") { $('.navbar').addClass('fixed'); //$('.logo img').attr('src','images/logo2.png'); } }) $('.to_top').click(function() { $('html, body').animate({ scrollTop: 0 }, 400); }) $(".case_list_body ul li").hover(function() { $(this).addClass("hover") $(this).find(".caselogo").stop(true, true).animate({ "top": "0" }, 400); $(this).find(".bgs_01").stop(true, true).animate({ "bottom": "0" }, 400); }, // logo function() { $(this).removeClass("hover") $(this).find(".caselogo").stop(true, true).animate({ }, 400); $(this).find(".bgs_01").stop(true, true).animate({ }, 400); }) $(".case_list2 ul li").hover(function() { $(this).find(".goto").stop(true, true).animate({ "margin-top": "-35%", "opacity": "1" }, { duration: 600, easing: "easeOutBounce" }); }, function() { $(this).find(".goto").stop(true, true).animate({ "margin-top": "-200%", "opacity": "0" }, { duration: 400 }); }) }); function scroll(fn) { var beforeScrollTop = document.body.scrollTop, fn = fn || function() {}; window.addEventListener("scroll", function() { var afterScrollTop = document.body.scrollTop, delta = afterScrollTop - beforeScrollTop; if (delta === 0) return false; fn(delta > 0 ? "down": "up"); beforeScrollTop = afterScrollTop; }, false); } /*******banner图*******/ $('.flexslider').flexslider({ animation: "fade", slideshow: true, animationSpeed: 1000, slideshowSpeed: 5000, animationSpeed: 1000, //滚动时间ms animationLoop: true, touch: true //是否支持触屏滑动 }); $('.flex-control-nav li a').html(''); /*************chanpin**************/ var mySwiper = new Swiper('.swiper-container', { nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', slidesPerView: 3, paginationClickable: true, }); /************* 广告 chanpin **************/ var $window = $(window); $window.scroll(function() { var h2 = $('.business_list').offset().top; var h3 = $('.swiper-container').offset().top; if ($(this).scrollTop() > h2 - 400 && $(this).scrollTop() < h2 + 400) { $('.business_txt').addClass('cur'); } if ($(this).scrollTop() > h3 - 300 && $(this).scrollTop() < h3 + 300) { $('.swiper-slide').addClass('act'); } }); $(document).ready(function(){ $("#testimonial-slider").owlCarousel({ items:2, itemsDesktop:[1000,1], itemsDesktopSmall:[979,1], itemsTablet:[768,1], pagination: true, autoPlay:true }); });