// 鎵嬫満浜岀淮鐮 var qrcode = function() { var baseQr = 'https://ssl.qdxin.cn/api.tech/qrxin.php?data='; var phoneQR = baseQr + setting.phone; $('#qrimg').attr('src', phoneQR); }(); var sliderIsMore = (slider_length > 1) ? true : false; if (!sliderIsMore) { $('.slider').eq(0).addClass('one-item'); } var mySwiper = $('#slides').swiper({ loop: sliderIsMore, pagination: '.pagination', grabCursor: sliderIsMore, paginationClickable: sliderIsMore, centeredSlides: sliderIsMore, watchActiveIndex: true, slidesPerView: sliderIsMore ? 2 : 1, mousewheelControl : true, autoplay : 4000, autoplayDisableOnInteraction : false, onAutoplayStop: function(swiper){ if(!swiper.support.transitions){ //IE7銆両E8 swiper.startAutoplay(); } } }); $('#slider-arrow-left').on('click', function(e){ e.preventDefault(); mySwiper.swipePrev(); }); $('#slider-arrow-right').on('click', function(e){ e.preventDefault(); mySwiper.swipeNext(); }); // 濡傛灉鍙湁涓€涓厓绱犳椂鍊 if (!sliderIsMore && mySwiper) { var allSlides = mySwiper.slides; var firstSlide = allSlides[0]; var oneImageBox = '
'; $('.slider-wrapper').eq(0).append($(oneImageBox)); $('#one-img-box').append(firstSlide); } // 涓哄簲瀵?13銆婁紭绉€鎻愭鑳屽悗鐨勬晠浜嬨€嬩复鏃舵彃鍏ョ殑banner // if(window.location.href.indexOf('313') > -1) { // let linEl = {}; // linEl.parent = $('.main').eq(0)[0]; // linEl.newsList = $('.news-list').eq(0)[0]; // linEl.banner = document.createElement('a'); // linEl.banner.className = 'lin-banner'; // linEl.banner.href = 'https://www.qdxin.cn/special/zt-app/app/?id=244'; // linEl.banner.innerHTML = ''; // linEl.parent.insertBefore(linEl.banner, linEl.newsList); // } // 鍘绘帀news-list绗竴涓猟l椤堕儴妯嚎 var dlFirstRemoveBorder = function() { var $dlFirst = $('#news-list').find('dl').eq(0); $dlFirst.addClass('no-top-border'); }(); // 璁剧疆骞翠唤 var setBotYear = function() { var year = new Date().getFullYear(); $('#nowyear').text(year); }(); // 瑙嗛鎾斁 $.fn.videoPlay = function() { var $videos = $(this); if ($videos.length <= 0 || !ispc) {return} // 鍒ゆ柇鏄惁鏀寔 var hasVideo = !!(document.createElement('video').canPlayType); if (hasVideo) { $videos.each(function() { // 鍒ゆ柇澶氫釜瑙嗛鐐瑰嚮闂 this.addEventListener('play', function () { var $videlPause = $videos.not(this); $videlPause.each(function(index, item) { item.pause(); }); }); }); } else { $('').replaceAll($(this)); } }; $('video').videoPlay(); /* 杩斿洖椤堕儴 */ (new GoTop()).init({ pageWidth: 1200, nodeId: 'go-top', nodeWidth: 40, distanceToBottom: 120, distanceToPage: 20, hideRegionHeight: 130, text: 'Top' }); /* ]]> */ // 缂栬緫浜哄憳 var editorShow = function() { var $editorBox = $('#editor'); if (!editors) { $editorBox.hide(); return; } var $nameBox = $editorBox.find('.editor-name').eq(0); var names = editors.split('|'); var namesStr = ''; $.each(names, function(index, item) { namesStr += '' + item + ''; }); $nameBox.append($(namesStr)); }(); // 鍙戝竷鏃堕棿 var publishTimeShow = function() { var $publishTime = $('#publish-time'); if (typeof publish_time == 'undefined' || !publish_time ) { $publishTime.hide(); return; } $publishTime.text(publish_time); }(); // 褰卞儚杞挱 var pictureSlider = function() { var picArr = []; $('.picture-swiper').each(function(index, picSw) { var $pagination = $(picSw).find('.pic-pagination').eq(0); picArr[index] = new Swiper(picSw,{ mousewheelControl : true, updateOnImagesReady : true, grabCursor: true, loop: true, pagination : $pagination[0], paginationClickable :true, autoplay : 4000, autoplayDisableOnInteraction : false, onAutoplayStop: function(swiper){ if(!swiper.support.transitions){ //IE7銆両E8 swiper.startAutoplay(); } } }) }); $('.picture-slider-img').on('load', function() { var imgWidth = this.width; var imgHeight = this.height; if(imgWidth/imgHeight < 1) { $(this).parent().addClass('image-center'); $(this).addClass('is-vertical'); } }); $('.picture-arrow-left').on('click', function(e){ e.preventDefault(); var $picSw = $(this).parents('.picture-swiper'); var index = $('.picture-swiper').index($picSw); picArr[index].swipePrev(); }); $('.picture-arrow-right').on('click', function(e){ e.preventDefault(); var $picSw = $(this).parents('.picture-swiper'); var index = $('.picture-swiper').index($picSw); picArr[index].swipeNext(); }); }();