PageSourceSearch

https://www.aladin.co.kr/ucl_editor/events/js/mOnly.js?ver=202609240526

js aladin.co.kr collected 2026-09-24 08:28:19 UTC 13,264 bytes, 409 lines download raw bytes

1var isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry/i.test(navigator.userAgent) ? true : false;
2
3jQuery(function(){
4    var eventH = jQuery('.evheader_wrap').outerHeight(); //pc À̺¥Æ® Çì´õ ³ôÀÌ
5    var RandomTab = jQuery('.RandomTab')
6    var bookList = jQuery('.monly_booklist_wrap');
7    var RandombookList = jQuery('.randomlist');
8    var AnchorTab = jQuery('.AnchorTab');
9    var allmenuH = jQuery('.monly_all_tab').outerHeight();
10    var menuH
11    var randomOST
12    var anchorOST
13    var safeAreaTop = getComputedStyle(document.documentElement).getPropertyValue("--sat")
14    var iosSat = parseFloat(safeAreaTop);
15    var customMenuH = jQuery('.custom_menu').outerHeight();
16
17    if(!isMobile) {
18        //PC
19        if (jQuery('.RandomTab').length) {
20            randomOST = jQuery('.RandomTab').offset().top - 1;
21        }
22        menuH = jQuery('.monly_swiper_tab').outerHeight();
23
24    } else {
25        if (jQuery('.RandomTab').length) {
26            randomOST = jQuery('.RandomTab').offset().top - iosSat - 10;
27            if(jQuery('.RandomTab').hasClass('android_top')) {
28                randomOST = jQuery('.RandomTab').offset().top - 35;
29            }
30        }
31        menuH = jQuery('.monly_swiper_tab').outerHeight();
32    }
33
34   
35   
36    if (jQuery('.AnchorTab').length) {
37        anchorOST = jQuery('.AnchorTab').offset().top  - iosSat - 10;
38        if(jQuery('.RandomTab').hasClass('android_top')) {
39            randomOST = jQuery('.RandomTab').offset().top - 35;
40        }
41    } 
42
43    // ²À ÀоîÁÖ¼¼¿ä Á¢±â / ÆîÄ¡±â
44    jQuery('.monly_info_box a, .monly_info_box .info_btn').click(function(){
45        var $btn = jQuery(this);
46        var panelId = $btn.attr('aria-controls');
47        var $panel = jQuery('#' + panelId);
48
49        var isExpanded = $btn.attr('aria-expanded') === 'true';
50
51        // »óÅ ¹ÝÀü
52        $btn.attr('aria-expanded', String(!isExpanded));
53        $btn.toggleClass('on', !isExpanded);
54
55        // ÆÐ³Î Ç¥½Ã/¼û±è
56        if (isExpanded) {
57            $panel.attr('hidden', true);
58        } else {
59            $panel.removeAttr('hidden');
60        }
61
62        if(jQuery(this).hasClass('on')) {    
63            if (jQuery('.RandomTab').length) {
64                randomOST = jQuery('.RandomTab').offset().top - 1;
65            } 
66            if (jQuery('.AnchorTab').length) {
67                anchorOST = jQuery('.AnchorTab').offset().top;
68            } 
69        } else {
70            if (jQuery('.RandomTab').length) {
71                randomOST = jQuery('.RandomTab').offset().top - 1;
72            } 
73            if (jQuery('.AnchorTab').length) {
74                anchorOST = jQuery('.AnchorTab').offset().top;
75            } 
76        }
77    });
78
79
80
81
82    jQuery(window).scroll(function () {
83        var windowTop = jQuery(window).scrollTop();
84
85        if (windowTop >= randomOST) {
86            jQuery(RandomTab).addClass('menufixed');
87            jQuery('.monly_swiper_tab_wrap .swiper-container').addClass('menufixed');
88            jQuery(RandombookList).css('padding-top',menuH)
89            jQuery(RandombookList).css('padding-top',allmenuH)
90            jQuery(RandombookList).css('padding-top',customMenuH)
91            jQuery('.evheader_wrap').slideUp(100);
92
93        } else if (windowTop >= anchorOST) {
94            jQuery(AnchorTab).addClass('menufixed');
95            jQuery('.monly_swiper_tab_wrap .swiper-container').addClass('menufixed');
96            jQuery('.evheader_wrap').slideUp(100);
97            jQuery(bookList).eq(0).css('padding-top',menuH)  
98        } else {
99            jQuery(RandomTab).removeClass('menufixed', 'android_top');
100            jQuery('.monly_swiper_tab_wrap .swiper-container').removeClass('menufixed', 'android_top');
101            jQuery(bookList).eq(0).css('padding-top',0);
102            jQuery(RandombookList).css('padding-top',0);
103            jQuery(AnchorTab).removeClass('menufixed', 'android_top');    
104            jQuery('.evheader_wrap').slideDown(100)
105        }  
106        
107
108        jQuery(bookList).each(function(idx){
109            var targetOST = jQuery(this).offset().top - 100;
110
111            if (targetOST - menuH <= windowTop) {
112                jQuery('.AnchorTab .swiper-slide').removeClass('on')
113                jQuery('.AnchorTab .swiper-slide').eq(idx).addClass('on')
114            }
115            
116        });
117
118        
119        var winHhalf = jQuery(window).height() / 1.2;
120
121        /* ÆäÀ̵åÀÎ ¸ð¼Ç */
122        jQuery('.fadein').each(function(){
123            if (jQuery('.fadein').length) {
124                var fadeinOST = jQuery(this).offset().top - winHhalf;
125            }
126        
127            if (windowTop >= fadeinOST) {
128                jQuery(this).addClass('active')
129            }
130        });
131
132        /* ¸ð¼Ç */
133        jQuery('.motion').each(function(){
134            if (jQuery('.motion').length) {
135                var fadeinOST = jQuery(this).offset().top - winHhalf;
136            }
137        
138            if (windowTop >= fadeinOST) {
139                jQuery(this).addClass('active')
140            }
141        });
142
143
144
145    });
146
147
148
149    // jQuery('.AnchorTab .swiper-slide').find('a').click(function(e){
150    //     e.preventDefault();
151    //     jQuery('html,body').scrollTop(jQuery(this.hash).offset().top - (menuH));
152    //     jQuery('.AnchorTab .swiper-slide').removeClass('on')
153    //     jQuery(this).parent().addClass('on')
154
155    //     if(jQuery(this).parent().index() == 0) {
156    //         jQuery(bookList).eq(0).css('padding-top',menuH);
157    //         jQuery('html,body').scrollTop(jQuery(this.hash).offset().top);
158    //     } 
159    // });
160
161    jQuery('.AnchorTab .swiper-slide a').each(function(){
162        jQuery(this).click(function(e){
163            e.preventDefault();
164            jQuery('html,body').scrollTop(jQuery(this.hash).offset().top - (menuH));
165            jQuery('.AnchorTab .swiper-slide').removeClass('on')
166            jQuery(this).parent().addClass('on')
167
168            if(jQuery(this).parent().index() == 0) {
169                jQuery(bookList).eq(0).css('padding-top',menuH);
170                jQuery('html,body').scrollTop(jQuery(this.hash).offset().top);
171            } 
172
173        });
174
175    });
176    
177
178
179 
180    // ÅÇ
181    var slideindex = jQuery('.monly_swiper_tab .swiper-slide.on').index();
182    var slidelength = jQuery('.monly_swiper_tab').find('.swiper-slide').length - 1;
183
184    var tabindex = 0
185        // if(slideindex == 0) {
186        //     jQuery('.monly_swiper_tab_wrap .thumbnail-button-prev').hide()
187        // }
188        // if(slideindex == slidelength) {
189        //     jQuery('.monly_swiper_tab_wrap .thumbnail-button-next').hide()
190        // }
191
192        if(!isMobile) {
193
194            if(slideindex >= 2) {
195                var tabindex = 1;
196            }    
197            if(slideindex >= 4) {
198                var tabindex = 3;
199            }
200            if(slideindex >= 6) {
201                var tabindex = 5;
202            }
203            if(slideindex >= 8) {
204                var tabindex = 7;
205            }  
206            if(slideindex >= 10) {
207                var tabindex = 9;
208            }  
209            if(slideindex >= 12) {
210                var tabindex = 11;
211            } 
212            if(slideindex >= 14) {
213                var tabindex = 13;
214            }                    
215        }
216        if(isMobile) {
217            if(slideindex >= 2) {
218                var tabindex = 2;
219            }    
220            if(slideindex >= 4) {
221                var tabindex = 4;
222            }
223            if(slideindex >= 6) {
224                var tabindex = 6;
225            }
226            if(slideindex >= 8) {
227                var tabindex = 8;
228            }  
229            if(slideindex >= 10) {
230                var tabindex = 10;
231            }  
232            if(slideindex >= 12) {
233                var tabindex = 12;
234            } 
235            if(slideindex >= 14) {
236                var tabindex = 14;
237            }      
238        }                                    
239
240    var tabswiper = new Swiper('.monly_swiper_tab', {
241        loop: false,
242        freeMode: true,
243        slidesPerView: 'auto',
244        initialSlide: tabindex,
245        navigation: {
246            nextEl: ".thumbnail-button-next",
247            prevEl: ".thumbnail-button-prev",
248        },
249    });        
250                
251   
252
253    // tabswiper.on('slideChange', function(){
254    //     var realIndex = tabswiper.realIndex;
255    //     if (realIndex == 0) {
256    //         jQuery('.monly_swiper_tab_wrap .thumbnail-button-prev').hide()
257    //         jQuery('.monly_swiper_tab_wrap .thumbnail-button-next').show()
258    //     } else {
259    //         jQuery('.monly_swiper_tab_wrap .thumbnail-button-prev').show()
260    //         jQuery('.monly_swiper_tab_wrap .thumbnail-button-next').show()
261
262    //     }
263    // });
264
265
266     
267
268    //ÁõÁ¤Ç° ½æ³×ÀÏ
269    // var swiper = new Swiper('.thumbnail_swiper', {
270    //     loop: false,
271    //     freeMode: {
272    //         enabled: true,
273    //         sticky: true,
274    //       },
275    //     slidesPerView: 'auto',
276        
277    //     navigation: {
278    //         nextEl: ".thumbnail-button-next",
279    //         prevEl: ".thumbnail-button-prev",
280    //     },
281      
282    // });
283    
284
285
286
287    jQuery('.thumbnail_wrap').each(function(){
288        var thumblength = jQuery(this).find('.swiper-slide').length;
289        if(thumblength <= 4){
290            jQuery(this).find('.swiper-wrapper').addClass('center')
291        } else {
292            jQuery(this).find('.thumbnail-button-next').addClass('on')
293            jQuery(this).find('.thumbnail-button-prev').addClass('on')
294        }
295    });
296
297   
298    
299    
300    // Ä¿ÇÇ À½¹Ý ¹öư ÇÏ´Ü °íÁ¤½Ã
301    var coffeebtn = jQuery('.monly_coffee_wrap .coffee_btn')
302    var musicbtn = jQuery('.monly_music_wrap .music_btn')
303    if(jQuery(coffeebtn).hasClass('fixed') || jQuery(musicbtn).hasClass('fixed')) {
304        jQuery('.floatNavi').css('bottom','80px')
305        jQuery('.floatNavi_share').css('bottom','80px')
306        jQuery(window).scroll(function () {
307
308                if (jQuery(window).scrollTop() > 100) {
309                    jQuery('.floatNavi_share').css('bottom','130px');
310                } else {
311                    jQuery('.floatNavi_share').css('bottom','80px');
312                }            
313        });
314    }
315
316
317
318    // ÅÛÇø´ 2.0 ÀúÀÚ Å¸ÀÔ1 ½½¶óÀ̵å
319    var authorimgSwiper = new Swiper(".author_type1_content .author_img", {
320        loop: true,
321        speed:800,
322        autoplay: {
323            delay: 8000,
324            disableOnInteraction: false,
325        },
326        navigation: {
327            nextEl: '.swiper-button-next',
328            prevEl: '.swiper-button-prev',
329        },
330        slidesPerView: 'auto',
331        centeredSlides: true,
332        slideToClickedSlide: true,
333        initialSlide : random_index(),            
334        on: {
335            activeIndexChange: function(){
336                var swiper = this;
337                var text = jQuery(".author_type1_content .author_book .book_box");
338                text.css("display", "none");
339                text[swiper.realIndex].style.display = "block";
340                if (jQuery('.RandomTab').length) {
341                    randomOST = jQuery('.RandomTab').offset().top - 1;
342                } 
343                if (jQuery('.AnchorTab').length) {
344                    anchorOST = jQuery('.AnchorTab').offset().top;
345                }                   
346            }
347        }            
348    });
349    jQuery('.author_type1_content .author_img .swiper_pause_btn').click(function(){
350        if(jQuery(this).hasClass('stop')) {
351            jQuery(this).removeClass('stop');
352            jQuery(this).text('ÀÚµ¿½½¶óÀÌµå ¸ØÃã')
353            authorimgSwiper.autoplay.start();
354        } else {
355            jQuery(this).addClass('stop');
356            jQuery(this).text('ÀÚµ¿½½¶óÀÌµå ½ÃÀÛ')
357            authorimgSwiper.autoplay.stop();
358        }
359    });
360
361
362
363});
364
365
366// ÆË¾÷
367function MM_openBrWindow(theURL,winName,features) { //v2.0
368    window.open(theURL,winName,features);
369  }
370// ½Å±ÔÁõÁ¤Ç°ÆË¾÷
371function opeSupplePop(url, index, name, options) {
372    var open = window.open(url + '?index=' + index, name, options);
373    open.focus();
374}
375
376// ½½¶óÀÌµå ·£´ý½Ã
377function random_index() {
378    var r_index = Math.floor(Math.random() * (jQuery('.random .swiper-slide').length));
379    return parseInt(r_index);
380  }
381
382
383document.addEventListener('click', function (e) {
384    const a = e.target.closest('a[data-event-popup]');
385    if (!a) return;
386
387    e.preventDefault();
388
389    const popupOptions = a.dataset.eventPopup;
390    const popupName = 'eventPopup';
391
392    let win = null;
393
394    try {
395        win = window.open(a.href, popupName, popupOptions);
396    } catch (err) {
397        // iOS WKWebView µî¿¡¼­ window.open()ÀÌ exceptionÀ» throwÇÏ´Â °æ¿ì
398        win = null;
399    }
400
401    if (!win || win.closed || typeof win.closed == 'undefined') {
402        // ÆË¾÷ Â÷´Ü ¶Ç´Â iOS WebView µî ÆË¾÷ ¹ÌÁö¿ø ȯ°æ ¡æ ÇöÀç â¿¡¼­ À̵¿
403        window.location.href = a.href;
404    } else {
405        win.focus();
406    }
407});
408
409

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.