1 2$(document).ready(function () { 3 4 $(document).on('click','.icon-toggle-menu-child',function(){ 5 $(this).toggleClass("is-active"); 6 $(".box-menu-child .icon-toggle-menu-child").toggleClass("active"); 7 $(this).siblings('.box-menu-child').toggleClass('active'); 8 $(this).parent('.wrap-menu-child').toggleClass('active'); 9 // 10 // $('body').toggleClass('overlay'); 11 $('.menu').toggleClass('active'); 12 $('header#header').toggleClass('active-menu'); 13 $('main#main').toggleClass('active-menu'); 14 $('footer#footer').toggleClass('active-menu'); 15 }); 16 $(document).mouseup(function (e) { 17 var container = $(".box-menu-child"); 18 if (!container.is(e.target) && 19 container.has(e.target).length === 0) { 20 if ($(".icon-toggle-menu-child").hasClass('is-active')) { 21 $(".icon-toggle-menu-child").removeClass("is-active"); 22 $(".icon-toggle-menu-child").removeClass('active'); 23 $('.box-menu-child').removeClass('active'); 24 $('.wrap-menu-child').removeClass('active'); 25 } 26 // $('body').removeClass('overlay'); 27 $('.menu').removeClass('active'); 28 $('header#header').removeClass('active-menu'); 29 $('main#main').removeClass('active-menu'); 30 $('footer#footer').removeClass('active-menu'); 31 32 } 33 }); 34 $(document).on('click','footer .icon-toggle-menu-child',function(){ 35 $('footer#footer').removeClass('active-menu'); 36 }); 37 38 $(document).on('click','.menu-header-main .box-menu-child .icon-toggle-menu-child',function(){ 39 $(this).parent('.menu-header-main .box-menu-child').toggleClass('active'); 40 $(".menu-header-main .box-menu-child .icon-toggle-menu-child").toggleClass('active'); 41 $(".menu-header-main .icon-toggle-menu-child").toggleClass('is-active'); 42 $('.menu-header-main .wrap-menu-child').toggleClass('active'); 43 }); 44 $(document).on('click','.menu-footer-main .box-menu-child .icon-toggle-menu-child',function(){ 45 $(this).parent('.menu-footer-main .box-menu-child').toggleClass('active'); 46 $(".menu-footer-main .box-menu-child .icon-toggle-menu-child").toggleClass('active'); 47 $(".menu-footer-main .icon-toggle-menu-child").toggleClass('is-active'); 48 $('.menu-footer-main .wrap-menu-child').toggleClass('active'); 49 }); 50 $(document).on('click','.box-menu-child .icon-toggle-menu-child',function(){ 51 $(this).removeClass('active'); 52 }); 53 54 // menu 55 // $(".icon-toggle-menu-child").click(function () { 56 // $('.menu .icon-bar').toggleClass('active'); 57 // $('body').toggleClass('overlay'); 58 // $('nav#nav').toggleClass('active'); 59 // $('header#header').toggleClass('active-menu'); 60 // $('main#main').toggleClass('active-menu'); 61 // $('footer#footer').toggleClass('active-menu'); 62 // }); 63 // $(document).mouseup(function (e) { 64 // var container = $(".box-menu-child"); 65 // if (!container.is(e.target) && 66 // container.has(e.target).length === 0) { 67 // $('.menu .icon-bar').removeClass('active'); 68 // $('body').removeClass('overlay'); 69 // $('.menu').removeClass('active'); 70 // $('header#header').removeClass('active-menu'); 71 // $('main#main').removeClass('active-menu'); 72 // $('footer#footer').removeClass('active-menu'); 73 // } 74 // }); 75 76 77 // customenu 78 function ResizeMemuMain() { 79 var arrClassParent = ['menu-header-main', 'menu-footer-main']; 80 for (let m = 0; m < arrClassParent.length; m++) { 81 $("."+ arrClassParent[m] + " .wrap-menu-child>.box-menu-child>.item").appendTo("."+ arrClassParent[m] + " .box-menu-display"); 82 $("."+ arrClassParent[m] + " .wrap-menu-child").remove(); 83 var win = $(window).width(); 84 if(win > 1024){ 85 var fixWidth = $("."+ arrClassParent[m] + " .box-menu-display").outerWidth() - 60; 86 var listLi = $("."+ arrClassParent[m] + " .box-menu-display>.item"); 87 var cWidth = 0; 88 var iMax = 0; 89 for (var i = 0; i < listLi.length; i++) { 90 cWidth += $(listLi[i]).outerWidth(); 91 if (cWidth > fixWidth) { 92 console.log(cWidth > fixWidth); 93 console.log(listLi[0]); 94 iMax = i; 95 break; 96 } 97 } 98 if (iMax > 0) { 99 var li2 = "<div class='wrap-menu-child'><div class='icon-toggle-menu-child'><span></span></div><div class='box-menu-child'></div></div>"; 100 $(li2).appendTo("."+ arrClassParent[m] + " .box-menu-display"); 101 102 var countMore = 0; 103 for (var i = iMax; i < listLi.length; i++) { 104 $(listLi[i]).appendTo("."+ arrClassParent[m] + " .box-menu-child"); 105 } 106 } 107 }else{ 108 var listLi = $("."+ arrClassParent[m] + " .box-menu-display>.item"); 109 var li2 = "<div class='wrap-menu-child'><div class='icon-toggle-menu-child'><span></span></div><div class='box-menu-child'></div></div>"; 110 $(li2).appendTo("."+ arrClassParent[m] + " .box-menu-display"); 111 for (var i = 1; i < listLi.length; i++) { 112 $(listLi[i]).appendTo("."+ arrClassParent[m] + " .box-menu-child"); 113 } 114 } 115 } 116 } 117 118 ResizeMemuMain(); 119 120 // submenu 121 $(".icon-toggle-menu").click(function () { 122 $(this).toggleClass('active'); 123 $(this).siblings('.menu-child').toggleClass('active'); 124 $(this).siblings('.menu-child').slideToggle(); 125 }); 126 var win = $(window).width(); 127 if(win < 1024){ 128 $('.box-menu-child').append("<div class='icon-toggle-menu-child'><span></span></div>") 129 } 130 $(window).resize(function() { 131 ResizeMemuMain(); 132 }); 133 134 135 // scroll top 136 $('.scroll-top').click(function () { 137 $('html, body').animate({ 138 scrollTop: 0 139 }, 500) 140 }); 141 var offset = 600, 142 $back_to_top = $('.scroll-top'); 143 $(window).scroll(function () { 144 ($(this).scrollTop() > offset) ? $back_to_top.addClass('visible-top') : $back_to_top.removeClass('visible-top'); 145 }); 146 147 // cover size text 148 149 var count = 16; 150 $("#minus").click(function () { 151 if (count > 10) { 152 count--; 153 $('.wrap-blog-detail-main *').css('font-size', +count + 'px'); 154 } 155 }); 156 $("#plus").click(function () { 157 if (count < 25) { 158 count++; 159 $('.wrap-blog-detail-main *').css('font-size', +count + 'px'); 160 } 161 }); 162 $('.cover-size span:first-child').click(function () { 163 $('.wrap-blog-detail-main *').css('font-size', '16px'); 164 }); 165 166 167 // get date now 168 function getTime() { 169 var objToday = new Date(), 170 weekday = new Array('Chá»§ Nháºt', 'Thứ Hai', 'Thứ Ba', 'Thứ Tư', 'Thứ NÄm', 'Thứ Sáu', 'Thứ Bảy'), 171 dayOfWeek = weekday[objToday.getDay()], 172 dayOfMonth = today + (objToday.getDate() < 10) ? '0' + objToday.getDate() : objToday.getDate(), 173 months = new Array('01', '02', '03', '04', '05', '06', '07', '08', '09', '10', '11', '12'), 174 curMonth = months[objToday.getMonth()], 175 curYear = objToday.getFullYear(), 176 curHour = objToday.getHours() < 10 ? "0" +objToday.getHours() : objToday.getHours(), 177 curMinute = objToday.getMinutes() < 10 ? "0" + objToday.getMinutes() : objToday.getMinutes(), 178 curSeconds = objToday.getSeconds() < 10 ? "0" + objToday.getSeconds() : objToday.getSeconds(); 179 var today = curHour + ":" + curMinute + ", " + dayOfWeek + ", ngà y " + dayOfMonth + "/" + curMonth + "/" + curYear; 180 document.getElementById('date-now').innerHTML = today; 181 } 182 setInterval(getTime, 1000); 183 184 185 // tabs right 186 187 $(".toggle-tab-item").click(function () { 188 $(this).siblings('.box-tab-child').slideToggle(); 189 $(this).toggleClass('active'); 190 }); 191 192 193}); 194 195// slide 196$('.slide-libary-toppage').owlCarousel({ 197 nav: true, 198 autoplay: true, 199 autoplayTimeout: 5000, 200 autoplayHoverPause: true, 201 margin: 0, 202 responsive: {
203 0: { 204 items: 1, 205 loop: ($('.slide-libary-toppage .item').length > 1) ? true : false, 206 }, 207 0: { 208 items: 1, 209 loop: ($('.slide-libary-toppage .item').length > 1) ? true : false, 210 }, 211 768: { 212 items: 2, 213 margin:15, 214 loop: ($('.slide-libary-toppage .item').length > 2) ? true : false, 215 }, 216 992: { 217 items: 1, 218 loop: ($('.slide-libary-toppage .item').length > 1) ? true : false, 219 }, 220 } 221}); 222$('.slide-magazine').owlCarousel({ 223 nav: true, 224 autoplay: true, 225 autoplayTimeout: 5000, 226 autoplayHoverPause: true, 227 margin: 15, 228 responsive: { 229 0: { 230 items: 2, 231 loop: ($('.slide-magazine .item').length > 2) ? true : false, 232 }, 233 540: { 234 items: 3, 235 loop: ($('.slide-magazine .item').length > 3) ? true : false, 236 }, 237 667: { 238 items: 4, 239 loop: ($('.slide-magazine .item').length > 4) ? true : false, 240 }, 241 768: { 242 items: 5, 243 loop: ($('.slide-magazine .item').length > 5) ? true : false, 244 }, 245 992: { 246 items: 2, 247 loop: ($('.slide-magazine .item').length > 2) ? true : false, 248 }, 249 } 250}); 251$('.owlCarousel5').owlCarousel({ 252 autoplay: true, 253 smartSpeed: 500, 254 autoplayTimeout: 3000, 255 autoplayHoverPause: false, 256 responsiveClass: true, 257 nav: false, 258 arrows: false, 259 responsive: { 260 0: { 261 items: 2, 262 loop: ($(".owlCarousel5 .item").length > 2) ? true : false, 263 }, 264 768: { 265 items: 6, 266 loop: ($(".owlCarousel5 .item").length > 6) ? true : false, 267 }, 268 1200: { 269 items: 6, 270 loop: ($(".owlCarousel5 .item").length > 6) ? true : false, 271 } 272 } 273}); 274$('#video-hot-main').owlCarousel({ 275 nav: true, 276 autoplay: true, 277 autoplayTimeout: 5000, 278 autoplayHoverPause: true, 279 margin: 15, 280 responsive: { 281 0: { 282 items: 1, 283 loop: ($('#video-hot-main .item').length > 1) ? true : false, 284 } 285 } 286}); 287 288$('#slide-links-website').owlCarousel({ 289 nav: true, 290 autoplay: true, 291 autoplayTimeout: 5000, 292 autoplayHoverPause: true, 293 margin: 20, 294 responsive: { 295 0: { 296 items: 1, 297 loop: ($('.slide-links .item').length > 1) ? true : false, 298 }, 299 428: { 300 items: 2, 301 loop: ($('.slide-links .item').length > 2) ? true : false, 302 }, 303 769: { 304 items: 3, 305 loop: ($('.slide-links .item').length > 3) ? true : false, 306 }, 307 1025: { 308 items: 4, 309 loop: ($('.slide-links .item').length > 4) ? true : false, 310 }, 311 1081: { 312 items: 5, 313 loop: ($('.slide-links .item').length > 5) ? true : false, 314 }, 315 1200: { 316 items: 6, 317 loop: ($('.slide-links .item').length > 6) ? true : false, 318 }, 319 } 320}); 321 322// // fix header 323// var prevScrollpos = window.pageYOffset; 324// window.onscroll = function() { 325// var currentScrollPos = window.pageYOffset; 326// if (prevScrollpos > currentScrollPos) { 327// $("#header").css({ 328// "position": "sticky", 329// "top": 0, 330// }); 331// $("#header").addClass('active'); 332// } else { 333// $("#header").css({ 334// "top": "-140px", 335// }); 336// $("#header").removeClass('active'); 337// } 338// prevScrollpos = currentScrollPos; 339// } 340 341// $(window).on('scroll', function () { 342// if ($(window).scrollTop()) { 343// $('#header:not(.header-project-detail-not-scroll)').addClass('active'); 344// } else { 345// $('#header:not(.header-project-detail-not-scroll)').removeClass('active') 346// }; 347// }); 348 349 350 351 352function resizeImage() { 353 let arrClass = [ 354 { class: 'cover-size-image-hot', number: (332 / 590) }, //0.5627118644067797 355 { class: 'cover-image-size-banner', number: (181 / 285) }, //0.6350877192982456 356 { class: 'cover-size-1', number: (56 / 98) }, //0.5714285714285714 357 { class: 'cover-size-2', number: (159 / 260) }, //0.6115384615384615 358 { class: 'cover-size-3', number: (76 / 136) }, //0.5588235294117647 359 { class: 'cover-size-4', number: (262 / 450) }, //0.5822222222222222 360 { class: 'cover-size-5', number: (121 / 216) }, //0.5601851851851852 361 { class: 'cover-size-6', number: (210 / 373) }, //0.5630026809651475 362 { class: 'cover-size-7', number: (95 / 170) }, //0.6724137931034483 363 { class: 'cover-size-8', number: (163 / 245) }, //0.6653061224489796 364 { class: 'cover-size-9', number: (77 / 115) }, //0.6695652173913043 365 { class: 'cover-size-10', number: (61 / 98) }, //0.6224489795918367 366 { class: 'cover-size-11', number: (151 / 270) }, //0.6224489795918367 367 { class: 'cover-size-12', number: (67 / 120) }, //0.5583333333333333 368 { class: 'cover-size-13', number: (105 / 187) }, //0.5614973262032086 369 { class: 'cover-size-14', number: (56 / 100) }, //0.56 370 { class: 'cover-size-15', number: (171 / 280) }, //0.6107142857142857 371 { class: 'cover-size-16', number: (80 / 244) }, // 372 { class: 'cover-size-17', number: (123 / 220) }, // 373 { class: 'cover-size-18', number: (78 / 140) }, // 374 { class: 'cover-size-19', number: (181 / 286) }, //0.6328671328671329 375 { class: 'cover-size-20', number: (151 / 107) }, // 376 { class: 'cover-size-21', number: (138 / 245) }, // 377 { class: 'cover-size-22', number: (44 / 78) }, // 378 { class: 'cover-size-23', number: (168 / 300) }, // 379 { class: 'cover-size-24', number: (181 / 272) }, // 380 { class: 'cover-size-25', number: (100 / 150) }, // 381 { class: 'cover-size-26', number: (380 / 271) }, // 382 { class: 'cover-size-27', number: (480 / 855) }, // 383 { class: 'cover-size-28', number: (278 / 417) }, // 384 { class: 'cover-size-29', number: (570 / 855) }, // 385 ]; 386 for (let i = 0; i < arrClass.length; i++) { 387 let width = $("." + arrClass[i]['class']).width(); 388 $("." + arrClass[i]['class']).css('height', width * arrClass[i]['number'] + 'px'); 389 // console.log(width); 390 // console.log(arrClass); 391 // console.log(width*arrClass[i]['number']); 392 } 393} 394resizeImage(); 395$(window).on('resize', function () { 396 resizeImage(); 397}); 398 399// active youtube 400function activeUrlVideo(attr) { 401 var id_video = $(attr).data('url'); 402 var symbol = $("#video-main")[0].src; 403 $("#video-main")[0].src = 'https://www.youtube.com/embed/' + id_video + '?autoplay=1'; 404} 405function closeVideo() { 406 var symbol = $("#video-main")[0].src; 407 var arr = symbol.split('embed/'); 408 $("#video-main")[0].src = arr[0] + 'embed/'; 409} 410$(".active-video").click(function () { 411 activeUrlVideo(this); 412}); 413$(".close").click(function () { 414 closeVideo(); 415}); 416$(document).mouseup(function (e) { 417 var container = $("#video-youtube .wrap-video-youtube"); 418 if (!container.is(e.target) && 419 container.has(e.target).length === 0) { 420 if ($('.modal').hasClass('show')) { 421 closeVideo(); 422 } 423 } 424}); 425 426
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.