1$(function(){ 2 3 var mql = window.matchMedia('screen and (max-width: 768px)'); 4 5 // ããã°ããã¼å¯¾å¿ 6 if($("#eyecatch").length) { 7 if($("#eyecatch .swiper-slide").length > 1) { 8 // ããã¼ç»åã2ã¤ä»¥ä¸ â ã¹ã©ã¤ãè¨å® 9 var galleryTop = new Swiper('#eyecatch .swiper-container', { 10 loop: true, // ç¹°ãè¿ãæå® 11 centeredSlides : true, 12 autoplay: { 13 // 10ç§å¾ã«æ¬¡ã®ç»å㸠14 delay: 10000, 15 // ã¦ã¼ã¶ã¼æä½å¾ã«èªååçãåéãã 16 disableOnInteraction: false 17 }, 18 slidesPerView: 1, 19 pagination: { 20 // åå½¢ã®ãã¼ã¸ãã¼ã·ã§ã³ãæå¹ã«ãã 21 el: "#eyecatch .swiper-pagination", 22 // ã¯ãªãã¯ãæå¹ã«ãã 23 clickable: true 24 }, 25 navigation: { 26 nextEl: '#eyecatch .swiper-button-next', 27 prevEl: '#eyecatch .swiper-button-prev', 28 } 29 }); 30 } else { 31 // ããã¼ç»åã1㤠â éç㪠32 $("#eyecatch").addClass('static'); 33 } 34 } 35 36 // ããããæ¸èª ã¹ã©ã¤ã 37 if($("#pickup").length) { 38 if($("#pickup .swiper-slide").length > 1) { 39 // ããã¼ç»åã2ã¤ä»¥ä¸ â ã¹ã©ã¤ãè¨å® 40 var pickup = new Swiper('#pickup .swiper-container', { 41 loop: true, // ç¹°ãè¿ãæå® 42 centeredSlides : true, 43 autoplay: { 44 // 10ç§å¾ã«æ¬¡ã®ç»å㸠45 delay: 10000, 46 // ã¦ã¼ã¶ã¼æä½å¾ã«èªååçãåéãã 47 disableOnInteraction: false, 48 pauseOnMouseEnter: true 49 }, 50 effect: "coverflow", 51 grabCursor: true, 52 coverflowEffect: { 53 rotate: 20, 54 stretch: 0, 55 depth: 200, 56 modifier: 1, 57 slideShadows: true, 58 }, 59 slidesPerView: 4, 60 pagination: { 61 // åå½¢ã®ãã¼ã¸ãã¼ã·ã§ã³ãæå¹ã«ãã 62 el: "#pickup .swiper-pagination", 63 // ã¯ãªãã¯ãæå¹ã«ãã 64 clickable: true 65 }, 66 navigation: { 67 nextEl: '#pickup .swiper-button-next', 68 prevEl: '#pickup .swiper-button-prev', 69 }, 70 breakpoints: { 71 768: { 72 slidesPerView: 3, 73 }, 74 480: { 75 slidesPerView: 2.5, 76 } 77 } 78 }); 79 80 // ã¹ã©ã¤ãã®ç»åã®èªã¿è¾¼ã¿ãå®äºãã 81 $(window).on('load', function () { 82 // .image ã®é«ããæå¤§ã®é«ãã«åããã â ããã¹ãé¨åãé£ã®æ¸å½±ã«ãã¶ããã 83 // â å®é㯠.content ã® margin-top ã調æ´ãã 84 // é«ãã®æå¤§å¤åå¾ãå ãã¦ å ¨ä½ã®é«ããè¨å®ããã 85 var mh = getHeight(); 86 87 // é«ãã®æå¤§å¤ã«ãã£ã¦ margin-topãè¨å® â ã«ã¬ã³ãã¨ä¸¡ç«¯ã®ã¿ 88 setMargin(mh); 89 90 // ç»é¢ãµã¤ãºãå¤ãã£ã â æå¤§ãµã¤ãº ååå¾ 91 pickup.on('resize', function () { 92 // é«ã ååå¾ãå ãã¦ å ¨ä½ã®é«ããè¨å®ããã 93 mh = getHeight(); 94 // é«ãã®æå¤§å¤ã«ãã£ã¦ margin-topãè¨å® â ã«ã¬ã³ãã¨ä¸¡ç«¯ã®ã¿ 95 setMargin(mh); 96 }); 97 98 // ã¹ã©ã¤ããåãæ¿ãã£ã 99 pickup.on('slideChange', function () { 100 // é«ãã®æå¤§å¤ã«ãã£ã¦ margin-topãè¨å® â ã«ã¬ã³ãã¨ä¸¡ç«¯ã®ã¿ 101 setMargin(mh); 102 }); 103 104 /** 105 * [getHeight é«ãã®æå¤§å¤ãåå¾ãå ãã¦ å ¨ä½ã®é«ããè¨å®ããã] 106 * @return {[int]} [é«ãã®æå¤§å¤] 107 */ 108 function getHeight() { 109 var mh = 0; 110 var ih = 0; 111 $("#pickup .swiper-slide").each(function(){ 112 if(mh < $(this).find('.image img').height()) { 113 mh = $(this).find('.image img').height(); 114 } 115 $(this).addClass('temporary'); 116 if(ih < $(this).height()) { 117 ih = $(this).height(); 118 } 119 $(this).removeClass('temporary'); 120 121 // å ¨ä½ã®é«ãè¨å® 122 // â ã¹ã©ã¤ããåãæ¿ãã£ãéã«é«ããã¬ã¿ã¬ã¿ããã®ãé²ã 123 changeHeight(); 124 125 mql.addEventListener('change', function() { 126 changeHeight(); 127 }) 128 function changeHeight(){ 129 if(mql.matches){ 130 $("#pickup .inner").height(ih + 35); 131 }else{ 132 $("#pickup .inner").height(ih + 50); 133 } 134 } 135 }); 136 137 return mh; 138 } 139 140 /** 141 * [setMargin é«ãã®æå¤§å¤ã«ãã£ã¦ margin-topãè¨å® â ã«ã¬ã³ãã¨ä¸¡ç«¯ã®ã¿] 142 * @param {[int]} mh [é«ãã®æå¤§å¤] 143 */ 144 function setMargin(mh) { 145 // ã«ã¬ã³ãã®indexåå¾ 146 var index = $("#pickup .swiper-slide.swiper-slide-active").index(); 147 148 // ã«ã¬ã³ãã®.imageã®é«ããåå¾ãã.contentã®margin-topã®å¤ãè¨ç®ãã¦è¨å® 149 // â å·¦å³ãã¿ã³ã§ã®åãæ¿ãããã©ãã°ã§ã®åãæ¿ãã«ãã£ã¦ 150 // ã¤ãã³ãçºç«æç¹ã®ã«ã¬ã³ããéããã 両端ã®å¤ãè¨å®ãã 151 // â ãã¹ã¦ä¸åº¦ã«è¨å®ãããã¨ãã㨠.imageã®é«ãã0ã®ãã®ãããããé£ãã 152 var mt = mh - $("#pickup .swiper-slide:eq(" + index +") .image").height(); 153 $("#pickup .swiper-slide:eq(" + index +") .content").css('marginTop',mt); 154 155 mt = mh - $("#pickup .swiper-slide:eq(" + (index - 1) +") .image").height(); 156 $("#pickup .swiper-slide:eq(" + (index - 1) +") .content").css('marginTop',mt); 157 158 mt = mh - $("#pickup .swiper-slide:eq(" + (index + 1) +") .image").height(); 159 $("#pickup .swiper-slide:eq(" + (index + 1) +") .content").css('marginTop',mt); 160 } 161 }); 162 } else { 163 // æ¸èªã1㤠â éç㪠164 $("#pickup").addClass('static'); 165 } 166 } 167 168 // ãããæ°åæ å ±: ã¹ããã§èè ã4å以ä¸ã®å ´åã«ãã»ããã追å ããå¦ç 169 addAuthorText(); 170 171 mql.addEventListener('change', function() { 172 addAuthorText() 173 }) 174 175 function addAuthorText(){ 176 $('#main_column .listType1 ul li').each(function(){ 177 var nHeight = $(this).find('.newbookInfo').height(); 178 var nTxtHeight = $(this).find('.newbookInfo .txt').height(); 179 var t = $(this).find('.newbookInfo .txt .author span'); 180 if(mql.matches && t.length > 4){ 181 $(this).find('.newbookInfo .txt .author').append('<span class="txtOther">ã»ã</span>'); 182 }else{ 183 $(this).find('.newbookInfo .txt .author .txtOther').remove(); 184 } 185 if(!mql.matches && nHeight < nTxtHeight){ 186 $(this).find('.newbookInfo').addClass('yScroll'); 187 }else{ 188 $(this).find('.newbookInfo').removeClass('yScroll'); 189 } 190 }) 191 } 192 193});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.