document.write(''); $(function () { Page_scrollTo(); //鍏煎鑻规灉X鏈哄瀷瀹夊叏璺濈 if (isIphoneX()) { $(".footbar").addClass('iosx'); } //杞挱 $('.swipebox').each(function (index) { var obj=$(this).children('.swipe')[0]; var speed = RndNum(5000, 8000); var pageid='pager'+index; var n = $(this).find('.swipeli').length; if ($(this).find('.pager em').length==0){ for (var i = 1; i <= n; i++) { $(this).find('.pager').append('' + i + ''); } } if ($(this).find('.swipeli').length > 1) { $(this).find("em:eq(0)").addClass("on"); } else { $(this).find('.swipenavi').hide(); } $(this).find('.pager').attr('id',pageid) Swipe(obj, { auto: speed, callback: function (index, element) { slideTab(index, pageid); } }); }) $('.dalislide').each(function(){ var obj = $(this); var speed = RndNum(5000, 8000); var direction = typeof($(this).attr("data-direction"))!="undefined" ? $(this).attr('data-direction') : 'left'; obj.daliSlide({ speed: speed, duration: 800, dotname: 'banb', dottxt: '', aroname: 'slideleft,slideright', direction: direction, callback: function(inidx, outidx) { obj.find('.slidethumb>div').eq(inidx).addClass('on'); obj.find('.slidethumb>div').eq(outidx).removeClass('on'); } }); }) $('.dalislide li').click(function(){ var link=$(this).attr('data-link'); if (link!='' && typeof(link)!="undefined"){ location.href=link; } }) $('.dalislide').bind('touchstart', function (e) { startX = e.originalEvent.changedTouches[0].pageX; startY = e.originalEvent.changedTouches[0].pageY; }); $(".dalislide").bind("touchmove", function (e) { var obj = $(this); //鑾峰彇婊戝姩灞忓箷鏃剁殑X,Y endX = e.originalEvent.changedTouches[0].pageX; endY = e.originalEvent.changedTouches[0].pageY; //鑾峰彇婊戝姩璺濈 distanceX = endX - startX; distanceY = endY - startY; //鍒ゆ柇婊戝姩鏂瑰悜 if (Math.abs(distanceX) > Math.abs(distanceY) && distanceX > 100) { //寰€鍙虫粦鍔 var idx = obj.find('.banb em.on').index() - 1; if (idx < 0) { idx = obj.find('.banb em').length - 1; } obj.find('.banb em').eq(idx).click(); } else if (Math.abs(distanceX) > Math.abs(distanceY) && distanceX < -100) { //寰€宸︽粦鍔 var idx = obj.find('.banb em.on').index() + 1; if (idx == obj.find('.banb em').length) { idx = 0; } obj.find('.banb em').eq(idx).click(); } else if (Math.abs(distanceX) < Math.abs(distanceY) && distanceY < 0) { //寰€涓婃粦鍔 } else if (Math.abs(distanceX) < Math.abs(distanceY) && distanceY > 0) { //寰€涓嬫粦鍔 } }); //瀵艰埅鑿滃崟 $('.navi li.on').children('ul').slideDown(); $(document).on('click','.mom,.momf',function(){ $('.mom,.momf').toggle() $(".navi").fadeToggle(); }) $(document).on('click','.navi li',function(){ if ($(this).hasClass("on")){ $(this).children('ul').slideUp(); $(this).removeClass('on') } else{ $(this).siblings('li').find('ul').slideUp(); $(this).siblings('li').removeClass('on') $(this).children('ul').slideDown(); $(this).addClass('on'); } }) $(document).on('click','.ficop', function(){ if ($(this).find('p').length>0){ $(this).find('p').show(); } }) $(document).on('click','.ficop p', function(){ setTimeout(function(){ $('.ficop p').fadeOut(); },200) }) //閾炬帴杞崲 $('.linkd').each(function () { if ($(this).attr('data-link') != '') { $(this).addClass('hand'); } }) $(document).on('click', '.linkd', function () { if ($(this).attr('data-link') != '') { location.href= $(this).attr('data-link'); } }) $(document).on('click','.linka',function(){ if ($(this).find('a').length>0){ location.href= $(this).find('a:eq(0)').attr('href'); } }) //澶氳鏂囨湰瀹炵幇婧㈠嚭鐪佺暐鍙凤紝鎴彇闀垮害0鍒欐牴鎹洅瀛愰珮搴﹁嚜閫傚簲 $('.cutstr').each(function () { cutstr($(this), 0); }) $('.cuthtml').each(function () { cutstr($(this), 0, 'html'); }) //鏂囨湰妗嗘暟瀛楁楠 $(document).on('blur', '.number', function () { if (isNaN($(this).val())) { alert("璇疯緭鍏ユ纭殑鏁板瓧鏍煎紡!"); $(this).val(""); } }); //hidethis 鐖舵爣绛炬坊鍔犳class绫诲悕锛寃ow鍔ㄧ敾绉诲嚭灞忓箷鍚庨噸鏂拌繘鍏ュ睆骞曟椂鍐嶆鎵ц鍔ㄧ敾 var scrolltimer = null; var t1 = 0; var t2 = 0; $(window).scroll(function () { clearTimeout(scrolltimer) scrolltimer = setTimeout(isScrollEnd, 10) t1 = $(this).scrollTop(); }); function isScrollEnd() { t2 = $(window).scrollTop(); if (t2 == t1) { clearTimeout(scrolltimer) var WH = $(window).height(); $('.hidethis').each(function () { var targT = $(this).offset().top; var targH = $(this).height(); $(this).height(targH); if (t1 >= targT + targH || t1 + WH <= targT) { $(this).find(".wow").hide(); } else { $(this).find(".wow").show(); } }) if (t1>50 || $(document).height()<=$(window).height()+50){ $('.footbar').addClass('in'); } else { $('.footbar').removeClass('in'); } } } //涓嶈冻涓€灞忔椂榛樿鏄剧ず搴曢儴瀵艰埅 if ($(document).height()<=$(window).height()+50){ $('.footbar').addClass('in'); } //灏唅mg鏍囩鐨剆vg鍥惧儚杞寲涓哄唴宓宻vg渚夸簬CSS鎺у埗 $('img.svg').each(function () { var obj = $(this); formatSVG(obj); }); //绂佹鍥剧墖鎷栨嫿 //$('img').attr('draggable', 'false'); }); //ajax鐐瑰嚮 function ajaxclick(id) { $.post('/ajax/click', { id: id }); } //鏍煎紡鍖杝vg鍥惧儚 function formatSVG(obj) { var $img = obj; var imgID = $img.attr('id'); var imgClass = $img.attr('class'); var imgURL = $img.attr('src'); jQuery.get(imgURL, function (data) { // Get the SVG tag, ignore the rest var $svg = jQuery(data).find('svg'); // Add replaced image's ID to the new SVG if (typeof imgID !== 'undefined') { $svg = $svg.attr('id', imgID); } // Add replaced image's classes to the new SVG if (typeof imgClass !== 'undefined') { $svg = $svg.attr('class', imgClass + ' replaced-svg'); } // Remove any invalid XML tags as per http://validator.w3.org $svg = $svg.removeAttr('xmlns:a'); // Check if the viewport is set, if the viewport is not set the SVG wont't scale. if (!$svg.attr('viewBox') && $svg.attr('height') && $svg.attr('width')) { $svg.attr('viewBox', '0 0 ' + $svg.attr('height') + ' ' + $svg.attr('width')) } // Replace image with new SVG $img.replaceWith($svg); $svg.css({'visibility': 'visible'}); }, 'xml'); } function checkkw() { if ($("#topkw").val() == '') { alert("璇疯緭鍏ユ煡璇㈠叧閿瘝锛?); return false; } else { return true; } } //璐村+ function showtips(title) { $("body").append("