").appendTo(a))}else r.splice(0,Math.min(l-n,Math.max(r.length-1,0)));e("
").appendTo(r[0]).append(e("").text(t.text()).attr("href","#"+ChangeToKd(t.attr("id")))),l=n})})},n=e.fn.toc;e.fn.toc=t,e.fn.toc.noConflict=function(){return e.fn.toc=n,this},e(function(){t.call(e("[data-toc]"))})}(window.jQuery);$(document).ready(function() { $('.rightfullkfgh').owlCarousel({ loop:false,rewind: true, margin:15, lazyLoad:false, nav:true, dots: false, autoplay: true, autoplayTimeout:5000, items:3, autoHeight:true, navText: ['', ''], }); $('.rightfullkf').owlCarousel({ loop:false,rewind: true, margin:15, lazyLoad:false, nav:true, dots: false, autoplay: true, autoplayTimeout:5000, items:2, autoHeight:true, navText: ['', ''], }); $(".products_cat_show").each(function() { var $this = jQuery(this); $this.owlCarousel({ loop:false, rewind: true, nav:true, dots: false, navText: ['', ''], autoplay: false, items:3, margin: 10 }); }); var idpost = $('body').attr('data-id'); var type = $('body').attr('data-type'); $('.bt-hoidap').on('click', function () {$('#input_cmt').toggle();$('html, body').css('overflow','hidden');$('html').append(''); }); $('body').on('click','.hdgia_bl', function(e) {$('#input_cmt').hide();$('html, body').css('overflow','auto');$('.hux_m').remove(); }); $('body').on('click','.box_updownpro', function(e) {$(this).parent('.bxsc').find('.item').css('display','block');$(this).remove(); }); $(".products_cat_show").each(function() { var $this = jQuery(this); $this.owlCarousel({ loop:false, rewind: true, nav:true, dots: false, navText: ['', ''], autoplay: false, items:3, margin: 10 }); }); $('body').on('click','.show-more', function(e){ e.preventDefault(); $('.article').css('height','auto'); $(this).remove(); }); $('body').on('click','.yeuthich', function(e) { e.preventDefault(); var idproduct = $(this).attr('data-id'); $.ajax({ url: 'https://baochauelec.com/AjaxEnt', type: 'POST', data: { _token : "fw3eC6ilIkVhVXuoGK8DMeGXV9JhL6LHmojDnD0f", idproduct: idproduct, action: 'yeuthich' }, success: function (data) { $('.yeuthich .iconwt-yeuthich').addClass('yeuthich_x'); $('.yeuthich_x').removeClass('iconwt-yeuthich'); $('.yeuthich').addClass('yeuthich_2'); $('.yeuthich_2').removeClass('yeuthich'); var cr_c = parseInt($('.ytcou').text())+1; $('.ytcou').html(cr_c); } }); }); $('body').on('click','.yeuthich_2', function(e) { e.preventDefault(); var idproduct = $(this).attr('data-id'); $.ajax({ url: 'https://baochauelec.com/AjaxEnt', type: 'POST', data: { _token : "fw3eC6ilIkVhVXuoGK8DMeGXV9JhL6LHmojDnD0f", idproduct: idproduct, action: 'watch_unlike' }, success: function (data) { $('.yeuthich_2 .yeuthich_x').addClass('iconwt-yeuthich'); $('.iconwt-yeuthich').removeClass('yeuthich_x'); $('.yeuthich_2').addClass('yeuthich'); $('.yeuthich').removeClass('yeuthich_2'); var cr_c = parseInt($('.ytcou').text())-1; $('.ytcou').html(cr_c); } }); }); }); $(document).ready(function () { $('body').on('click', '#p_guidanhgia', function(e){ e.preventDefault(); $this = $(this); var commentdata = $("#input_cmt").serialize(); var posttype = $(this).attr('data-posttype'); $.ajax({ url: 'https://baochauelec.com/AjaxEnt', type : 'POST', data : {_token : "fw3eC6ilIkVhVXuoGK8DMeGXV9JhL6LHmojDnD0f",commentdata : commentdata,posttype : posttype, action : 'p_comment' }, beforeSend: function(){ $(".page-type-post").prepend(''); }, success : function(data) { if (data==0) { $this.parents('.extCt').find('.alert').text('Số điện thoại, Tên, Nội dung bình luận là bắt buộc'); $this.parents('.extCt').find('.alert').css('display','block'); } else { $('.ratingLst').prepend(data); $('#input_cmt').hide(); $('html, body').css('overflow','auto'); $('.hux_m').remove(); $('#p_name').val(''); $('#p_phone').val(''); } $('#preloader').remove(); } }); }); $('body').on('click', '.hdgia', function(e){e.preventDefault();$('.input_formstar').css('display','none');$('.hux_m').remove();$('html, body').css('overflow','auto'); }); $('body').on('click', '.tlcmtr', function(e){e.preventDefault();var id = $(this).attr('id');$('.tlrr-'+id).css('display','block'); }); $('body').on('click', '.tlcmtr', function (e) {e.preventDefault();var dataclass = $(this).attr('data-class');var id = $(this).attr('data-id');var dataclass = $(this).attr('data-class');$('.modal_p_cmt').show();$(".b_r_p_button").attr("id", id);$(".b_r_p_button").attr("data-class", dataclass);var parent = $(this).attr('id');$('.readycss').addClass('reply_input'+parent+dataclass);$('.b_r_p_button').attr('id',parent);$('html, body').css('overflow','hidden'); }); $('body').on('click','.p_close_cmtpost', function(e) {$('.modal_p_cmt').hide();$('#readycss').attr('class','');$('#readycss').addClass('readycss');$('html, body').css('overflow','auto'); }); $('body').on('click', '.b_r_p_button', function (e) {e.preventDefault();var dataclass = $(this).attr('data-class');var parent = $(this).attr('id');var r_p_name = $('.r_p_name').val();var r_p_phone = $('.r_p_phone').val();var content = $('.reply_input' + parent + dataclass).val();var p_id = $('#p_id').val();if (parent =='' || r_p_name =='' || r_p_phone =='' || content =='') { alert('Bạn phải điền đầy đủ thông tin')} else { $.ajax({url: 'https://baochauelec.com/AjaxEnt',type: 'POST',data: { _token : "fw3eC6ilIkVhVXuoGK8DMeGXV9JhL6LHmojDnD0f", dataclass: dataclass, parent: parent, name: r_p_name, phone: r_p_phone, p_id: p_id, content: content, action: 'cmt_product'},beforeSend: function(){$(".page-type-post").prepend('');},success: function (data) { $('.modal_p_cmt').hide(); $('#r-' + parent + dataclass).append(data); $('.r_p_name').val(''); $('.r_p_mail').val(''); $('.reply_input' + parent + dataclass).val(''); $(".b_r_p_button").attr("id", ''); $('#preloader').remove();},error: function () { $('#formstar .alert').removeClass('hidden'); $('#formstar .alert').html('Đã có lỗi xảy ra, hãy thử lại.');} });} }); $('body').on('click','.hdgia_tl_cmt', function(e) {$('.modal_p_cmt').toggle();$('html, body').css('overflow','auto'); }); $('body').on('click','.cmtl', function(e) {$(this).html('1 Thích'); }); if ($('.main-content-hi h2').length > 0 || $('.main-content-hi h3').length > 0 ) {$(".main-content-hi h2:first-child").before("Mục lục bài viết (Thu gọn)(Mở rộng)
");$("Xem nhanh (Thu gọn)(Mở rộng)
").insertAfter(".main-content-hi > p:first-child");$("#toc").toc({content: ".main-content-hi", headings: "h2,h3"}); } $(".tdtale .an").click(function(){ $("#toc").css('display','none'); $(".an").css('display','none'); $(".hien").css('display','inherit'); }); $(".tdtale .hien").click(function(){ $("#toc").css('display','block'); $(".hien").css('display','none'); $(".an").css('display','inherit'); }); $('body').on('click','.btnYt', function(e) {var urlk = $(this).parents('.youtube-play').attr('data-link');var c = new URL(urlk);var ufli ='https://www.youtube.com/embed/'+c.searchParams.get("v")+'?autoplay=1';$(this).parents('.youtube-play').html(''); }); });