PageSourceSearch

https://palanla.com/front/template/default/assets/js/custom.js?v=1

js palanla.com collected 2026-10-02 19:48:54 UTC 22,131 bytes, 631 lines download raw bytes

1var owlrecommend = $('.owl-recommend');
2var owlrecommendeating = $('.owl-eating');
3var owlrecommendtravel = $('.owl-travel');
4var owlrecommendhotel = $('.owl-hotel');
5var owltraveldomestic = $('.owl-domestic');
6var owltravelaboard = $('.owl-aboard');
7var owltestimonial = $('.owl-testimonial');
8var owlrelational = $('.owl-relational');
9var owlhighlightvideo = $('.owl-highlight-video');
10var a_name;
11var width, height, img, frameWidth, frameHeight;
12
13//var myLazyLoad = new LazyLoad();
14
15$("img.lazy").lazyload();
16
17
18$(document).ready(function() {
19    // PDFObject.embed("/pdf/sample-3pp.pdf", "#body_pdf");
20    //-------------get text to link------------------------
21    var con_th = "ข้อกำหนด และเงื่อนไขการใช้บริการ";
22    var con_eng = "terms of use";
23    var con_lang = $("#c_lang").val();
24    var con_word = $("#check_condition span").text();
25    if (con_lang === "th") {
26        var coditions_sub = con_word.split(con_th);
27        var html_con = "<a href='#' data-toggle='modal' data-target='#condition_page'>" + con_th + "</a>";
28        $("#check_condition span").html(coditions_sub[0] + html_con + coditions_sub[1]);
29    } else {
30        var coditions_sub = con_word.split(con_eng);
31        var html_con = "<a href='#' data-toggle='modal' data-target='#condition_page'>" + con_eng + "</a>";
32        $("#check_condition span").html(coditions_sub[0] + html_con + coditions_sub[1]);
33    }
34
35    var con_word = $("#check_condition_panel_fb span").text();
36    if (con_lang === "th") {
37        var coditions_sub = con_word.split(con_th);
38        var html_con = "<a href='#' data-toggle='modal' data-target='#condition_page'>" + con_th + "</a>";
39        $("#check_condition_panel_fb span").html(coditions_sub[0] + html_con + coditions_sub[1]);
40    } else {
41        var coditions_sub = con_word.split(con_eng);
42        var html_con = "<a href='#' data-toggle='modal' data-target='#condition_page'>" + con_eng + "</a>";
43        $("#check_condition_panel_fb span").html(coditions_sub[0] + html_con + coditions_sub[1]);
44    }
45    //-----------------------------------------------------
46    // $(".texteditor").jqte();
47
48    $('.search-wrapper i.fa-search').click(function() {
49        $('.search-header').toggleClass('active');
50        $('.search-wrapper i.fa-search').toggleClass('active');
51        $('.search').toggleClass('active');
52        $('.overlay').toggleClass('active');
53    });
54
55    $('.overlay').click(function() {
56        $('.search-header').toggleClass('active');
57        $('.search-wrapper i.fa-search').toggleClass('active');
58        $('.search').toggleClass('active');
59        $('.overlay').toggleClass('active');
60    });
61
62    $("#share").jsSocials({
63        shareIn: "popup",
64        showCount: true,
65        shares: ["twitter", "facebook"]
66    });
67
68    setTimeout(function() {
69        $('.myreviewbox .img-wrapper').each(function() {
70            frameWidth = $(this).outerWidth();
71            frameHeight = $(this).outerHeight();
72            img = $(this).find('img');
73            width = parseInt(img.prop("width"));
74            height = parseInt(img.prop("height"));
75            //alert(Math.round((width)*1.0215)+ '  ' + Math.round((height)*1.0215));
76            $(img).removeClass('resize');
77
78            //console.log(width + ' ' + frameWidth);
79
80            if (width <= frameWidth && height >= frameHeight) {
81                $(img).addClass('resize');
82            }
83            /*else
84            {
85            	console.log(width + 'x' + height + ' ' + frameWidth + 'x' + frameHeight);
86            }*/
87        });
88    }, 1000);
89
90
91    $('.gallery-box').each(function() {
92        $(this).magnificPopup({
93            delegate: 'a.magnificPopup',
94            type: 'image',
95            image: {
96                // options for image content type
97                titleSrc: function(item) {
98                    return item.el.parents('.img-inner-wrapper').find('.overlay-below-info').html();
99                }
100            },
101            gallery: {
102                enabled: true, // set to true to enable gallery
103
104                navigateByImgClick: true,
105
106                arrowMarkup: '<button title="%title%" type="button" class="mfp-arrow mfp-arrow-%dir%"></button>', // markup of an arrow button
107
108                tPrev: 'Previous (Left arrow key)', // title for left button
109                tNext: 'Next (Right arrow key)', // title for right button
110                tCounter: '<span class="mfp-counter">%curr% of %total%</span>' // markup of counter
111            },
112            zoom: {
113                enabled: true,
114                duration: 300
115            }
116        });
117    });
118
119    //$("[data-fancybox]").each(function(){
120    $("[data-fancybox]").fancybox({
121
122        // Options will go here
123        //afterLoad : function( instance, slide ){
124        //$('.fancybox-button--thumbs').trigger('click');
125        //$('.fancybox-button--play').trigger('click');
126        //caption = ;
127        //},
128        speed: 1000,
129
130        touch: { momentum: true },
131
132        slideShow: {
133            autoStart: false,
134            speed: 2000
135        },
136
137        thumbs: {
138            autoStart: true, // Display thumbnails on opening
139            hideOnClose: true // Hide thumbnail grid when closing animation starts
140        },
141
142        caption: function(instance, item) {
143            var caption;
144
145            if (item.type === 'image') {
146                caption = $(this).parents('.img-inner-wrapper').find('.overlay-below-info').html();
147
148
149                return caption;
150            }
151
152        }
153    });
154
155    //});
156
157
158    owltestimonial.each(function() {
159        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
160        {
161            $(this).owlCarousel({
162                //Autoplay
163                loop: true,
164                autoHeight: true,
165                navigation: true,
166                //autoplay : true,
167                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
168                responsive: {
169                    0: {
170                        items: 1,
171                        nav: true
172                    },
173                    479: {
174                        items: 1,
175                        nav: true
176                    },
177                    1199: {
178                        items: 1,
179                        nav: true
180                    }
181                }
182            });
183        }
184
185        // else
186        // {
187        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
188        // }
189    });
190
191
192    owlrelational.each(function() {
193        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
194        {
195            $(this).owlCarousel({
196                //Autoplay
197                loop: true,
198                navigation: true,
199                autoplay: true,
200                autoplayTimeout: 10000,
201                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
202                responsive: {
203                    0: {
204                        items: 1,
205                        nav: true,
206                        dots: false,
207                        autoplayTimeout: 6000,
208                    },
209                    521: {
210                        items: 2,
211                        nav: true,
212                        dots: true
213                    },
214                    1199: {
215                        items: 3,
216                        nav: true,
217                        dots: true
218                    }
219                }
220            });
221        }
222
223        // else
224        // {
225        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
226        // }
227    });
228
229    owlhighlightvideo.each(function() {
230        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
231        {
232            $(this).owlCarousel({
233                //Autoplay
234                loop: true,
235                dots: true,
236                navigation: false,
237                autoplay: true,
238                margin: 3,
239                autoplayTimeout: 10000,
240                smartSpeed: 5000,
241                responsive: {
242                    0: {
243                        items: 1,
244                        nav: true,
245                        dots: true,
246                    },
247                    521: {
248                        items: 1,
249                        nav: true,
250                        dots: true
251                    },
252                    1199: {
253                        items: 1,
254                        nav: true,
255                        dots: true
256                    }
257                }
258            });
259        }
260
261        // else
262        // {
263        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
264        // }
265    });
266
267    owlrecommend.each(function() {
268        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
269        {
270            $(this).owlCarousel({
271                //Autoplay
272                loop: true,
273                margin: 11,
274                navigation: true,
275                //autoplay : true,
276                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
277                responsive: {
278                    0: {
279                        items: 1,
280                        nav: true
281                    },
282                    479: {
283                        items: 2,
284                        nav: true
285                    },
286                    1199: {
287                        items: 3,
288                        nav: true
289                    }
290                }
291            });
292        }
293
294        // else
295        // {
296        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
297        // }
298    });
299
300
301    owlrecommendeating.each(function() {
302        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
303        {
304            $(this).owlCarousel({
305                //Autoplay
306                loop: true,
307                navigation: true,
308                //autoplay : true,
309                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
310                responsive: {
311                    0: {
312                        items: 1,
313                        nav: true
314                    },
315                    479: {
316                        items: 2,
317                        nav: true
318                    },
319                    1199: {
320                        items: 3,
321                        nav: true
322                    }
323                }
324            });
325        }
326
327        // else
328        // {
329        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
330        // }
331    });
332
333
334    owlrecommendtravel.each(function() {
335        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
336        {
337            $(this).owlCarousel({
338                //Autoplay
339                loop: true,
340                navigation: true,
341                //autoplay : true,
342                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
343                responsive: {
344                    0: {
345                        items: 1,
346                        nav: true
347                    },
348                    479: {
349                        items: 2,
350                        nav: true
351                    },
352                    1199: {
353                        items: 3,
354                        nav: true
355                    }
356                }
357            });
358        }
359
360        // else
361        // {
362        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
363        // }
364    });
365
366
367    owlrecommendhotel.each(function() {
368        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
369        {
370            $(this).owlCarousel({
371                //Autoplay
372                loop: true,
373                navigation: true,
374                //autoplay : true,
375                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
376                responsive: {
377                    0: {
378                        items: 1,
379                        nav: true
380                    },
381                    479: {
382                        items: 2,
383                        nav: true
384                    },
385                    1199: {
386                        items: 3,
387                        nav: true
388                    }
389                }
390            });
391        }
392
393        // else
394        // {
395        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
396        // }
397    });
398
399
400
401    owltraveldomestic.each(function() {
402        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
403        {
404            $(this).owlCarousel({
405                //Autoplay
406                loop: true,
407                navigation: true,
408                //autoplay : true,
409                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
410                responsive: {
411                    0: {
412                        items: 1,
413                        nav: true
414                    },
415                    479: {
416                        items: 2,
417                        nav: true
418                    },
419                    1199: {
420                        items: 3,
421                        nav: true
422                    }
423                }
424            });
425        }
426
427        // else
428        // {
429        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
430        // }
431    });
432
433
434    owltravelaboard.each(function() {
435        if ($(this).find(".item").length > 1) // create carousel if more then 1 item
436        {
437            $(this).owlCarousel({
438                //Autoplay
439                loop: true,
440                navigation: true,
441                //autoplay : true,
442                navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
443                responsive: {
444                    0: {
445                        items: 1,
446                        nav: true
447                    },
448                    479: {
449                        items: 2,
450                        nav: true
451                    },
452                    1199: {
453                        items: 3,
454                        nav: true
455                    }
456                }
457            });
458        }
459
460        // else
461        // {
462        // 	$(this).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded');
463        // }
464    });
465
466
467    // fix owl-carousel bug if element hidding on page ready
468
469    if (!$(".tab-pane").hasClass('actived')) {
470        $(".tab-pane").each(function() {
471            $(this).removeClass('active');
472            $(this).parent().find("div").first().addClass('active');
473        });
474    } else {
475        $(".tab-pane").each(function() {
476            $(this).removeClass('active');
477            $(this).parent().find('.actived').addClass('active');
478        });
479        //alert('found');
480    }
481
482
483
484    if ($(this).scrollTop() > 311) {
485        if ($('body').hasClass('excepthome')) {
486            $('.excepthome .navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
487            $('.excepthome .topline li a').css({ 'color': 'black' });
488            $('.excepthome .topline li').css({ 'color': 'black' });
489        } else {
490            $('.navbar-inverse').css({ 'background-color': 'white', 'box-shadow': '0 0 8px rgba(0, 0, 0, 0.45)' });
491            $('.navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
492            $('#tell_first').css({ 'color': 'black' });
493            $('.navbar-inverse .widget>div .fa').css({ 'color': 'black' });
494            $('.navbar-inverse .navbar-toggle').css({ 'border-color': 'black' });
495            $('.navbar-inverse .navbar-toggle .icon-bar').css({ 'background-color': 'black' });
496            $('.topline li a').css({ 'color': 'black' });
497        }
498    } else {
499        if ($('body').hasClass('excepthome')) {
500            $('.excepthome .navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
501            $('.excepthome .topline li a').css({ 'color': 'black' });
502            $('.excepthome .topline li').css({ 'color': 'black' });
503        } else {
504            $('.navbar-inverse').css({ 'background-color': 'transparent', 'box-shadow': 'none' });
505            $('.navbar-inverse .navbar-nav>li>a').css({ 'color': 'white' });
506            $('.navbar-inverse .widget>div .fa').css({ 'color': 'white' });
507            $('#tell_first').css({ 'color': 'white' });
508            $('.navbar-inverse .navbar-toggle').css({ 'border-color': 'white' });
509            $('.navbar-inverse .navbar-toggle .icon-bar').css({ 'background-color': 'white' });
510            $('.topline li a').css({ 'color': 'white' });
511        }
512    }
513
514    $(function() {
515        var menuhighlight = $('html, body').find('.pagepointer').attr('name')
516            /*$('.showSingle').removeClass('focused');*/
517        $('#menu' + menuhighlight).toggleClass('active');
518
519    });
520
521
522
523
524});
525
526
527/*Change Nav BG when scroll down*/
528$(document).scroll(function() {
529    if ($(this).scrollTop() > 311) {
530        if ($('body').hasClass('excepthome')) {
531            $('.excepthome .navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
532            $('.excepthome .topline li a').css({ 'color': 'black' });
533            $('.excepthome .topline li').css({ 'color': 'black' });
534        } else {
535            $('.navbar-inverse').css({ 'background-color': 'white', 'box-shadow': '0 0 8px rgba(0, 0, 0, 0.45)' });
536            $('.navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
537            $('.navbar-inverse .widget>div .fa').css({ 'color': 'black' });
538            $('#tell_first').css({ 'color': 'black' });
539            $('.navbar-inverse .navbar-toggle').css({ 'border-color': 'black' });
540            $('.navbar-inverse .navbar-toggle .icon-bar').css({ 'background-color': 'black' });
541            $('.topline li a').css({ 'color': 'black' });
542        }
543    } else {
544        if ($('body').hasClass('excepthome')) {
545            $('.excepthome .navbar-inverse .navbar-nav>li>a').css({ 'color': 'black' });
546            $('.excepthome .topline li a').css({ 'color': 'black' });
547            $('.excepthome .topline li').css({ 'color': 'black' });
548        } else {
549            $('.navbar-inverse').css({ 'background-color': 'transparent', 'box-shadow': 'none' });
550            $('.navbar-inverse .navbar-nav>li>a').css({ 'color': 'white' });
551            $('.navbar-inverse .widget>div .fa').css({ 'color': 'white' });
552            $('#tell_first').css({ 'color': 'white' });
553            $('.navbar-inverse .navbar-toggle').css({ 'border-color': 'white' });
554            $('.navbar-inverse .navbar-toggle .icon-bar').css({ 'background-color': 'white' });
555            $('.topline li a').css({ 'color': 'white' });
556        }
557    }
558});
559
560$(document).scroll(function() {
561    if ($(this).scrollTop() > ($(this).outerHeight() / 5)) {
562        $('.toRelational').css({ 'opacity': '1', 'bottom': '10px' });
563        if ($('.toRelational').length) {
564            $('#topcontrol').css({ 'bottom': '55px' });
565        }
566
567    } else {
568        $('.toRelational').css({ 'opacity': '0', 'bottom': '-50px' });
569        $('#topcontrol').css({ 'bottom': '5px' });
570    }
571});
572
573$(document).on('click', ".toRelational", function() {
574    $('html, body').animate({
575        scrollTop: $(".relational-article-wrapper a.anchor").offset().top
576    }, (($(document).outerHeight() - $(window).scrollTop()) / (4)));
577});
578
579
580$(document).on('click', ".pagePill", function() {
581    $('html, body').animate({
582        scrollTop: $(".tab-pane.active a.anchor").offset().top
583    }, 1000);
584});
585
586
587// fix carousel in hidden tab and resize bug by rebuilt
588
589$('.nav-pills>li').on('click', function(e) {
590
591    a_name = $(this).attr('name');
592
593
594    $('.owl-' + a_name).trigger('destroy.owl.carousel').removeClass('owl-carousel owl-loaded owl-theme').find('.owl-stage-outer').children().unwrap();
595
596    setTimeout(rebuilt, 200); //settimeout for wait hidden tab content appear
597});
598
599
600function rebuilt() {
601    if ($('.owl-' + a_name).find(".item").length > 1) {
602        $('.owl-' + a_name).owlCarousel({
603            //Autoplay
604            loop: true,
605            navigation: true,
606            //autoplay : true,
607            navText: ["<img src='front/template/default/assets/images/myprevimage.png'>", "<img src='front/template/default/assets/images/mynextimage.png'>"],
608            responsive: {
609                0: {
610                    items: 1,
611                    nav: true
612                },
613                479: {
614                    items: 2,
615                    nav: true
616                },
617                1199: {
618                    items: 3,
619                    nav: true
620                }
621            }
622        });
623    }
624}
625
626
627$("#btnlang a").click(function() {
628    $("a").removeClass("active");
629    $(this).addClass("active");
630
631});

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.