锘?/--------------鏃犲浘鍥惧儚 var nullimg = '../images/error.png' function lod(t) { t.onerror = null t.src = nullimg } $(function() { $('.ratio-img').each(function() { if ($(this).attr('src') == '') { $(this).attr({ src: nullimg }) } }) // var u = navigator.userAgent, // app = navigator.appVersion // var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Linux') > -1 //瀹夊崜缁堢 // var isIOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/) //ios缁堢 // if (isAndroid) { // //鍒ゆ柇涓哄畨鍗撴墜鏈 // console.log('杩欓噷瀹夊崜鎵嬫満') // } // if (isIOS) { // //鍒ゆ柇涓鸿嫻鏋滄墜鏈 // console.log('杩欓噷鑻规灉鎵嬫満') // var ua = navigator.userAgent.toLowerCase() //鎶撳彇娴忚鍣║A鍊 // if (ua.match(/ qq/i) == 'qq') { // alert('qq') // $('.footer-nav ').css('bottom', 30) // } // if (ua.indexOf('micromessenger') > -1) { // console.log('杩欓噷鏄嫻鏋滄墜鏈哄井淇″唴缃祻瑙堝櫒') // } // } }) //end $(function() { //--------------棣栭〉banner var mySwiper = new Swiper('.inbanner', { autoplay: 3000, //鍙€夐€夐」锛岃嚜鍔ㄦ粦鍔 pagination: '.swiper-pagination', paginationClickable: true }) //--------------棣栭〉鍝佺墝鏍忕洰婊戝姩 var mySwiper1 = new Swiper('.in_b03_item', { slidesPerView: 'auto' }) //--------------棣栭〉鏂囧寲涔嬫梾 $('.in_block04').on('touchstart', touchStart) // $(".in_block04").on("touchmove", touchMove); $('.in_block04').on('touchend', touchEnd) function touchStart(event) { $(this).addClass('on') } // function touchMove(event) { // // $("on").html("You are moving"); // // $(this).addClass("on"); // } function touchEnd(event) { $(this).removeClass('on') } //--------------琛岄椤靛搧鐗屾爮鐩偣鍑籥jax鍒囨崲 $('.in_b03_item .swiper-slide').click(function() { $(this) .addClass('on') .siblings() .removeClass('on') ajaxFun_now($(this).data('src')) }) if ($('.in_b03_item .swiper-slide').size() > 0) { $('.in_b03_item .swiper-slide:eq(' + 0 + ')').addClass('on') ajaxFun_now($('.in_b03_item .swiper-slide:eq(' + 0 + ')').data('src')) } else { $('.in_b03_con').remove() } //--------------棣栭〉瀹樻柟寰俊鐐瑰嚮寮瑰嚭浜岀淮鐮 $(document).on('click', '.in_block05 li.weixin_li', function() { $('.weixin_bg,.weixin_code').addClass('on') }) $(document).on('click', '.weixin_bg', function() { $('.weixin_bg,.weixin_code').removeClass('on') }) $(document).on('click', '.footer-nav li', function() { $(this) .addClass('on') .siblings('li') .removeClass('on') }) //--------------鍏敤閫夐」鍗″垏鎹 $(document).on('click', '.tab-box .tab-a', function() { $(this) .addClass('on') .siblings() .removeClass('on') var ii = $(this).index() //$.getScript("../javascript/ratio-img.js"); $(this) .parents('.tab-box') .find('.tab-b') .eq(ii) .show() .siblings() .hide() }) // $('.tab-box').each(function(i) { $(this) .find('.tab-a:eq(0)') .click() }) //end //鎵嬫満绔簳閮ㄦ偓娴彍鍗 $(window).scroll(function() { var theHeight = $(document).height() - $('.footer').height() * 0.65 //console.log($(window).scrollTop()); if ($(window).scrollTop() >= theHeight) { $('.footer-nav').removeClass('on') } else { $('.footer-nav').addClass('on') } if ($(window).scrollTop() > 0) { $('.page_arr_up').addClass('on') } else { $('.page_arr_up').removeClass('on') } }) //end //鎵嬫満绔鑸紑濮 $(window).resize(function() { $(document).off('click', '.nav_phone_btn') $(document).on('click', '.nav_phone_btn', function() { if ($(this).hasClass('visible_nav')) { $(this).removeClass('visible_nav') $('.menu').removeClass('on') } else { $(this).addClass('visible_nav') $('.menu').addClass('on') return false } }) }) $(window).resize() $(document).on('click', '.header_inner>ul>li', function() { $(this).addClass('on') }) $(document).on('click', '.header_inner>ul>li ul>li:first-child', function(e) { $('.header_inner>ul>li').removeClass('on') e.stopPropagation() }) }) //--------------琛屼笟鍔ㄦ€佹爮鐩偣鍑籥jax鍒囨崲 function ajaxFun_now(url) { $.ajax({ url: url, type: 'GET', success: function(msg) { $('#in_b03_list').html(msg) } }) }