PageSourceSearch

https://www.thailife.com/public/js/init.js

js thailife.com collected 2026-10-01 11:49:53 UTC 7,596 bytes, 219 lines download raw bytes

1banner_slide = function() {
2    var oneSlider = ($('.bxslider').children().length < 2);
3    $('.bxslider').bxSlider({
4        auto: (!oneSlider),
5        pager: (!oneSlider),
6        controls: false,
7        pause: 5000,
8        onSlideAfter: function($slideElement, oldIndex, newIndex) {
9            $(".box-txtSlider ul li").fadeOut(500);
10            $(".box-txtSlider ul li").eq(newIndex).fadeIn(1000);
11        },
12    });
13}
14header = function() {
15    $('.nav-menuMB').click(function() {
16        $('.menuMB').addClass('active');
17        $('.section-search-wrapper').removeClass('active');
18    });
19    $('.closeMenu').click(function() {
20        $(this).closest('.menuMB').removeClass('active');
21    });
22    $('.menuMB-lv1 li.inc-menuMB-lv2 .icon-toggle').click(function() {
23        $('.menuMB-lv1 li.inc-menuMB-lv2 .icon-toggle').not(this).parents('.inc-menuMB-lv2').removeClass('active');
24        $(this).parents('.inc-menuMB-lv2').toggleClass('active');
25    });
26    $('.menuMB-lv2 li.inc-menuMB-lv3').click(function() {
27        $('.menuMB-lv2 li.inc-menuMB-lv3').not(this).removeClass('active');
28        $(this).toggleClass('active');
29    });
30    $('.search_MB').click(function() {
31        $('.section-search-wrapper').toggleClass('active');
32    });
33    $(window).scroll(function() {
34        if ($(window).scrollTop() > 100) {
35            $('.navmain').addClass('scrollhide');
36            $('.section-logo-search').hide();
37            $('.section-search-wrapper').removeClass('active');
38            $('.navbottom').addClass('scrollshow');
39        } else {
40            $('.navmain').removeClass('scrollhide');
41            $('.section-logo-search').show();
42            $('.navbottom').removeClass('scrollshow');
43        }
44    });
45    $('.navbottom').hover(function() {
46        $('.navmain').removeClass('scrollhide');
47        $('.section-logo-search').show();
48        $('.navbottom').removeClass('scrollshow');
49    });
50    $('.icon-search').click(function() {
51        $('.section-search-wrapper').toggleClass('active');
52    });
53    $('.btn-close').click(function() {
54        $(this).closest('.section-search-wrapper').removeClass('active');
55    });
56    $('.submenu-quicklink ul li').hover(function() {
57        $('.section-search-wrapper').removeClass('active');
58    });
59    $('.language').click(function() {
60        $(this).toggleClass('show');
61    });
62}
63selectric = function() {
64    $('.slc-tric').selectric({
65        maxHeight: 200
66    });
67}
68footer = function() {
69    $('.title-sitemap').click(function() {
70        $('.col-md-12').toggleClass('section-sitmapMB');
71        $('.menu-sitemap').toggleClass('active');
72    });
73}
74
75function scrollToTop() {
76    verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
77    element = $('body');
78    offset = element.offset();
79    offsetTop = offset.top;
80    $('html, body').animate({
81        scrollTop: offsetTop
82    }, 500, 'linear');
83}
84$(function() {
85    $(document).on('scroll', function() {
86        if ($(window).scrollTop() > 100) {
87            $('.scroll-up-wrapper').addClass('show');
88        } else {
89            $('.scroll-up-wrapper').removeClass('show');
90        }
91    });
92    $('.scroll-up-wrapper').on('click', scrollToTop);
93});
94$(function() {
95    var options = {
96        url: "resources/countries.json",
97        getValue: "name",
98        list: {
99            match: {
100                enabled: true
101            }
102        },
103    };
104    $("#txtSearch").easyAutocomplete(options);
105});
106$(function() {
107    var cus_height = $('.group-content-Top').height();
108    console.log(cus_height);
109    $('.solid_2').css('height', cus_height);
110});
111FormatFiled = function() {
112    $('.Keythaionly').bind('keypress', function(e) {
113        var charCode = (e.which) ? e.which : e.keyCode;
114        if (charCode > 160 || charCode == 8) {
115            return true;
116        } else {
117            return false;
118        }
119    });
120    $('.Keyengonly').bind('keypress', function(e) {
121        var charCode = (e.which) ? e.which : e.keyCode;
122        if ((charCode >= 97 && charCode <= 122) || (charCode >= 65 && charCode <= 90) || charCode == 8 || charCode == 9 || charCo
122de == 127 || charCode == 13 || charCode == 37 || charCode == 38 || charCode == 39 || charCode == 40 || charCode == 32) {
123            return true;
124        } else {
125            return false;
126        }
127    });
128    $('.Keyengnumber').bind('keypress', function(e) {
129        var charCode = (e.which) ? e.which : e.keyCode;
130        if ((charCode >= 97 && charCode <= 122) || (charCode >= 65 && charCode <= 90) || (charCode >= 48 && charCode <= 57) || charCode == 8 || charCode == 9 || charCode == 127 || charCode == 13 || charCode == 37 || charCode == 38 || charCode == 39 || charCode == 40 || charCode == 32) {
131            return true;
132        } else {
133            return false;
134        }
135    });
136    $(".Keyemailonly").on("keypress", function(e) {
137        var code = e.charCode || e.keyCode;
138        var ch = String.fromCharCode(code);
139        if ((ch < "0" || "9" < ch) && (ch < "A" || "Z" < ch) && (ch < "a" || "z" < ch) && (ch != "@") && (ch != ".") && (ch != "-") && (ch != "_") && (e.keyCode != 8) && (e.keyCode != 13)) {
140            return false;
141        }
142    });
143    $('.KeynumonlyP').bind('keypress', function(e) {
144        var charCode = (e.which) ? e.which : e.keyCode;
145        if ((charCode >= 48 && charCode <= 57) || charCode == 8) {
146            return true;
147        } else {
148            return false;
149        }
150    });
151    $('.Keynumonly').bind('keypress', function(e) {
152        var charCode = (e.which) ? e.which : e.keyCode;
153        if ((charCode >= 40 && charCode <= 57) || charCode == 8 || charCode == 190) {
154            return true;
155        } else {
156            return false;
157        }
158    });
159}
160
161function Keythaionly(e) {
162    var charCode = (e.which) ? e.which : e.keyCode;
163    if (charCode > 160 || charCode == 8) {
164        return true;
165    } else {
166        return false;
167    }
168}
169
170function Keyengonly(e) {
171    var charCode = (e.which) ? e.which : e.keyCode;
172    if ((charCode >= 97 && charCode <= 122) || (charCode >= 65 && charCode <= 90) || charCode == 8 || charCode == 9 || charCode == 127 || charCode == 13 || charCode == 37 || charCode == 38 || charCode == 39 || charCode == 40 || charCo
172de == 32) {
173        return true;
174    } else {
175        return false;
176    }
177}
178
179function Keyengnumber(e) {
180    var charCode = (e.which) ? e.which : e.keyCode;
181    if ((charCode >= 97 && charCode <= 122) || (charCode >= 65 && charCode <= 90) || (charCode >= 48 && charCode <= 57) || charCode == 8 || charCode == 9 || charCode == 127 || charCode == 13 || charCode == 37 || charCode == 38 || charCode == 39 || charCode == 40 || charCode == 32) {
182        return true;
183    } else {
184        return false;
185    }
186}
187
188function Keyemailonly(e) {
189    var code = e.charCode || e.keyCode;
190    var ch = String.fromCharCode(code);
191    if ((ch < "0" || "9" < ch) && (ch < "A" || "Z" < ch) && (ch < "a" || "z" < ch) && (ch != "@") && (ch != ".") && (ch != "-") && (ch != "_") && (e.keyCode != 8) && (e.keyCode != 13)) {
192        return false;
193    }
194}
195
196function KeynumonlyP(e) {
197    var charCode = (e.which) ? e.which : e.keyCode;
198    if ((charCode >= 48 && charCode <= 57) || charCode == 8) {
199        return true;
200    } else {
201        return false;
202    }
203}
204
205function Keynumonly(e) {
206    var charCode = (e.which) ? e.which : e.keyCode;
207    if ((charCode >= 40 && charCode <= 57) || charCode == 8 || charCode == 190) {
208        return true;
209    } else {
210        return false;
211    }
212}
213$(document).ready(function() {
214    banner_slide();
215    header();
216    selectric();
217    footer();
218    FormatFiled();
219});

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.