$(function(){ // 椤甸潰楂樹寒 $('[data-id=' + pageObj._detailId + ']').addClass('active'); // 榛樿鎺т欢鈥斺€斿浘鐗囨斁澶с€愬嬁鏀广€ $(".fancyImg").each(function(){ let fancyImg = $(this).find("img").attr("src"); $(this).parents(".fancyboxHz").attr("data-src",fancyImg) }); // 鏃犳帶浠垛€斺€斿浘鐗囨斁澶 $('.fancyImg-02 img').each(function(){ let iText = $(this).attr('alt'); $(this).parent().append('

'+ iText +'

'); $(this).parents(".fancyboxHz").attr("data-caption",iText) }); // ==> 鏁堟灉缁勪欢JS // 鍥剧墖鏀惧ぇ-02 鍥鹃泦鍙傛暟 $require(['swiper'], function () { var imgTuBox = new Swiper ('.imgTuBig', { slidesPerGroup : 1, //婊氬姩涓暟 slidesPerView : 2, //鍒 spaceBetween : 15, //鍙宠竟璺 grid: { fill: 'row', rows: 1, //琛 }, pagination: { el: '.imgTuBig .swiper-pagination', clickable :true, }, navigation: { nextEl: '.imgTuBig .swiper-button-next', prevEl: '.imgTuBig .swiper-button-prev', }, breakpoints: { 768: { //褰撳睆骞曞搴﹀ぇ浜庣瓑浜?68 slidesPerView: 5, spaceBetween : 20, //鍙宠竟璺 }, } }) }) // 鍥剧墖鏀惧ぇ-03 鍙傛暟鍙傝€僪ttps://www.dowebok.com/214.html*/ }) $(document).scroll(function(){ // 椤甸潰寰€涓嬫粴鍔ㄥ悗娣诲姞鐨勭被鍚 if(window.scrollY >= 50){ $('body > .main > div:nth-child(1)').addClass('downClass'); }else{ $('body > .main > div:nth-child(1)').removeClass('downClass'); } // 銆愪娇鐢ㄦ柟娉曘€ // 1銆佷娇鐢ㄦ椂鍙嚜鐢辫缃窛绂婚《閮ㄧ殑楂樺害 // 2銆乨ownClass绫诲悕濡備笉婊¤冻鍙嚜鐢辩紪杈戜负鍏朵粬绫诲悕 // 3銆佸叿浣撳疄鐜扮殑鏍峰紡闇€瑕佽嚜琛屽埌鏍峰紡鏂囦欢閲屽畾涔塪ownClass鎴栬€呭凡淇敼涓哄叾浠栫殑绫诲悕鏍峰紡 });