');this.$currentImage=o.find(".slbImage"),this.options.showCaptions&&this.captions[s]&&o.append('
'+this.captions[s]+"
"),this.loadImage(n,(function(){e.setImageDimensions(),i.call(e,o),e.loadImage(e.items[e.normalizePosition(e.currentPosition+1)])}))}return this},loadImage:function(t,s){if(!this.options.videoRegex.test(t)){var i=new Image;s&&(i.onload=s),i.src=t}},setupLightboxHtml:function(){var s=this.options;return this.$el||(this.$el=t(''),this.items.length>1&&t('").appendTo(this.$el.find(".slbContentOuter")),this.$content=this.$el.find(".slbContent")),this},show:function(){return this.modalInDom||(this.$el.appendTo(this.options.appendTarget),i.addClass(this.options.htmlClass),this.setupLightboxEvents(),this.modalInDom=!0),this},setContent:function(s){var i=t(s);return clearTimeout(this.loadingTimeout),this.setupLightboxHtml(),this.options.beforeSetContent&&this.options.beforeSetContent(i,this),this.$content.html(i),this},setImageDimensions:function(){this.$currentImage&&this.$currentImage.css("max-height",n.height()+"px")},setupLightboxEvents:function(){var s=this;this.lightboxEventsSetuped||(this.$el.on("click"+this.ens,(function(i){var e=t(i.target);e.is(".slbCloseBtn")||s.options.closeOnOverlayClick&&e.is(".slbWrap")?s.close():e.is(".slbArrow")?e.hasClass("next")?s.next():s.prev():s.options.nextOnImageClick&&s.items.length>1&&e.is(".slbImage")&&s.next()})),e.on("keyup"+this.ens,(function(t){27===t.keyCode&&s.close(),s.items.length>1&&((39===t.keyCode||68===t.keyCode)&&s.next(),(37===t.keyCode||65===t.keyCode)&&s.prev())})),n.on("resize"+this.ens,(function(){s.setImageDimensions()})),this.lightboxEventsSetuped=!0)},close:function(){this.modalInDom&&(this.beforeClose&&this.beforeClose(this),this.$el&&this.$el.off(this.ens),e.off(this.ens),n.off(this.ens),this.lightboxEventsSetuped=!1,this.$el.detach(),i.removeClass(this.options.htmlClass),this.modalInDom=!1)},destroy:function(){this.close(),this.beforeDestroy&&this.beforeDestroy(this),this.$items&&this.$items.off(this.ens),this.$el&&this.$el.remove()}}),o.open=function(t){var s=new o(t);return t.content?s.setContent(t.content).show():s.showPosition(s.options.startAt)},t.fn.simpleLightbox=function(s){var i,e=this;return this.each((function(){t.data(this,"simpleLightbox")||(i=i||new o(t.extend({},s,{$items:e})),t.data(this,"simpleLightbox",i))}))},t.simpleLightbox=o}(window.jQuery||window.Zepto||window.simpleQuery);/*js toc*/function ChangeToKd(e){return(slug="@"+(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=(slug=e.toLowerCase()).replace(/á|à|ả|ạ|ã|ă|ắ|ằ|ẳ|ẵ|ặ|â|ấ|ầ|ẩ|ẫ|ậ/gi,"a")).replace(/é|è|ẻ|ẽ|ẹ|ê|ế|ề|ể|ễ|ệ/gi,"e")).replace(/i|í|ì|ỉ|ĩ|ị/gi,"i")).replace(/ó|ò|ỏ|õ|ọ|ô|ố|ồ|ổ|ỗ|ộ|ơ|ớ|ờ|ở|ỡ|ợ/gi,"o")).replace(/ú|ù|ủ|ũ|ụ|ư|ứ|ừ|ử|ữ|ự/gi,"u")).replace(/ý|ỳ|ỷ|ỹ|ỵ/gi,"y")).replace(/đ/gi,"d")).replace(/\`|\~|\!|\@|\#|\||\$|\%|\^|\&|\*|\(|\)|\+|\=|\,|\.|\/|\?|\>|\<|\'|\"|\:|\;/gi,"")).replace(/ /gi,"-")).replace(/_/gi,"-")).replace(/\-\-\-\-\-/gi,"-")).replace(/\-\-\-\-/gi,"-")).replace(/\-\-\-/gi,"-")).replace(/\-\-/gi,"-"))+"@").replace(/\@\-|\-\@|\@/gi,"")}!function(e){"use strict";var t=function(t){return this.each(function(){var n,i,a=e(this),c=a.data(),r=[a],o=this.tagName,l=0;i=(n=e.extend({content:"body",headings:"h1,h2,h3"},{content:c.toc||void 0,headings:c.tocHeadings||void 0},t)).headings.split(","),e(n.content).find(n.headings).attr("id",function(t,n){return n||function(e){0===e.length&&(e="?");for(var t=e.replace(/\s+/g,"_"),n="",i=1;null!==document.getElementById(t+n);)n="_"+i++;return ChangeToKd(t+n)}(e(this).text())}).each(function(){var t=e(this),n=e.map(i,function(e,n){return t.is(e)?n:void 0})[0];if(n>l){var a=r[0].children("li:last")[0];a&&r.unshift(e("<"+o+"/>").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);/*end js toc*/function viewpost(idpost){ $.ajax({ url: 'https://sanxuatson.vn/AjaxEnt', method:"POST", data:{ _token: "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", idpost: idpost, action:"viewpost" }, success:function(data) { } });}$(document).ready(function() { $('.bbcwtva_ct_tab_item a').simpleLightbox(); var idpost = $('.page-type-post').attr('data-id'); setTimeout(function() { viewpost(idpost); }, 5000); var height_hu = $('.article').height(); if (height_hu > 1400) { $('.article').css('height', '1400px'); $('.article').css('overflow', 'hidden'); $('').insertAfter('.article'); } $('body').on('click','.bbcwtva_tab span', function(e){ var pas = $(this).parents('.bbcwtva'); var datatab = $(this).attr('data'); $(pas).find('.bbcwtva_ct_tab_item').css('display','none'); $(pas).find('.hux-'+datatab).css('display','grid'); $('.bbcwtva_tab span').removeClass('active_h'); $(this).addClass('active_h'); }); $('body').on('click','.show-more', function(e){ e.preventDefault(); $('.article').css('height','auto'); $(this).remove(); }); $('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://sanxuatson.vn/AjaxEnt', type: 'POST', data: { _token : "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", 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://sanxuatson.vn/AjaxEnt', type: 'POST', data: { _token : "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", 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://sanxuatson.vn/AjaxEnt', type : 'POST', data : { _token : "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", commentdata : commentdata, posttype : posttype, action : 'p_comment' }, 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(''); } } }); }); $('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 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 = $('.p_forminfo .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://sanxuatson.vn/AjaxEnt', type: 'POST', data: { _token : "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", dataclass: dataclass, parent: parent, name: r_p_name, phone: r_p_phone, p_id: p_id, content: content, action: 'cmt_product' }, 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", ''); }, 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'); }); $(".article h2:first-child").before("Tóm Tắt Nội Dung [Ẩn] [Hiện]
"); $("Tóm Tắt Nội Dung [Ẩn | Hiện]
").insertAfter(".article > p:first-child"); $("#toc").toc({content: ".article", headings: "h2,h3"}); $(".tdtale .an").click(function(){ $("#toc").css('display','none'); $(".hien").css('display','inherit'); }); $(".tdtale .hien").click(function(){ $("#toc").css('display','block'); $(".an").css('display','inherit'); }); $('.ent-section-header').click(function() { let $this = $(this); $this.toggleClass("closed active"); $this.siblings().slideToggle(); return false; }); $('#s1').on('click', function () { $('#s1').removeClass('iconcom-unstar'); $('#s1').addClass('iconcom-star'); $('#s2').removeClass('iconcom-star'); $('#s3').removeClass('iconcom-star'); $('#s4').removeClass('iconcom-star'); $('#s5').removeClass('iconcom-star'); $('#s2').addClass('iconcom-unstar'); $('#s3').addClass('iconcom-unstar'); $('#s4').addClass('iconcom-unstar'); $('#s5').addClass('iconcom-unstar'); var content = 'Không thích'; $('.rsStar').html(content); $('.rsStar').css('display', 'inline-block'); }); $('#s2').on('click', function () { $('#s1').removeClass('iconcom-unstar'); $('#s2').removeClass('iconcom-unstar'); $('#s1').addClass('iconcom-star'); $('#s2').addClass('iconcom-star'); $('#s3').removeClass('iconcom-star'); $('#s4').removeClass('iconcom-star'); $('#s5').removeClass('iconcom-star'); $('#s3').addClass('iconcom-unstar'); $('#s4').addClass('iconcom-unstar'); $('#s5').addClass('iconcom-unstar'); var content = 'Tạm được'; $('.rsStar').html(content); $('.rsStar').css('display', 'inline-block'); }); $('#s3').on('click', function () { $('#s1').removeClass('iconcom-unstar'); $('#s2').removeClass('iconcom-unstar'); $('#s3').removeClass('iconcom-unstar'); $('#s1').addClass('iconcom-star'); $('#s2').addClass('iconcom-star'); $('#s3').addClass('iconcom-star'); $('#s4').removeClass('iconcom-star'); $('#s5').removeClass('iconcom-star'); $('#s4').addClass('iconcom-unstar'); $('#s5').addClass('iconcom-unstar'); var content = 'Bình thường'; $('.rsStar').html(content); $('.rsStar').css('display', 'inline-block'); }); $('#s4').on('click', function () { $('#s1').removeClass('iconcom-unstar'); $('#s2').removeClass('iconcom-unstar'); $('#s3').removeClass('iconcom-unstar'); $('#s4').removeClass('iconcom-unstar'); $('#s1').addClass('iconcom-star'); $('#s2').addClass('iconcom-star'); $('#s3').addClass('iconcom-star'); $('#s4').addClass('iconcom-star'); $('#s5').removeClass('iconcom-star'); $('#s5').addClass('iconcom-unstar'); var content = 'Rất tốt'; $('.rsStar').html(content); $('.rsStar').css('display', 'inline-block'); }); $('#s5').on('click', function () { $('#s1').removeClass('iconcom-unstar'); $('#s2').removeClass('iconcom-unstar'); $('#s3').removeClass('iconcom-unstar'); $('#s4').removeClass('iconcom-unstar'); $('#s5').removeClass('iconcom-unstar'); $('#s1').addClass('iconcom-star'); $('#s2').addClass('iconcom-star'); $('#s3').addClass('iconcom-star'); $('#s4').addClass('iconcom-star'); $('#s5').addClass('iconcom-star'); var content = 'Tuyệt vời quá'; $('.rsStar').html(content); $('.rsStar').css('display', 'inline-block'); }); $('.lStar > i').on('click', function () { $('.ipt').css('display', 'block'); var id = $(this).attr('id').replace(/[^0-9]/gi, ''); var id_int = parseInt(id, 10); $('#hdfStar').val(id_int); }); $('body').on('click','.ratecl', function(e) { e.preventDefault(); var star = $('#hdfStar').val(); var idpost = $('#hdfProductID').val(); $.ajax({ url: 'https://sanxuatson.vn/AjaxEnt', type : 'POST', data : { _token : "OLTsKndPWdp9UXe287AN3NqBCXV9WCXCHrwFVF04", star : star, idpost: idpost, action : 'starpost' }, success : function(data) { } }); });});$(document).ready(function(){ $('body').on('click', '.next', function(){ var datastep = $(this).attr('data-step'); var e = 1; var stepnext = parseInt(datastep) + parseInt(e); var chieudai = $('input[name="chieudai"]').val(); var chieurong = $('input[name="chieurong"]').val(); var sotang = $('input[name="sotang"]').val(); if (chieudai == '' || chieurong == '' || sotang == '') { $(".error").html("Vui lòng điền đẩy đủ và chính xác thông tin!"); } else { $(".tinhson_step"+datastep).css('display','none'); $(".tinhson_step"+stepnext).css('display','block'); $(".tinhson_nav ul li").removeClass('active'); $(".tab"+stepnext).addClass('active'); } }); $('body').on('click', '.previous', function(){ var datastep = $(this).attr('data-step'); var e = 1; var stepnext = parseInt(datastep) - parseInt(e); $(".tinhson_step"+datastep).css('display','none'); $(".tinhson_step"+stepnext).css('display','block'); $(".tinhson_nav ul li").removeClass('active'); $(".tab"+stepnext).addClass('active'); }); var widthhtml = $('body').width(); var widthsection= $('section').width(); var rightfix = (parseInt(widthhtml) - parseInt(widthsection))/2; $('.siteorigin-panels-stretch').css('margin-left','-'+rightfix+'px'); $('.siteorigin-panels-stretch').css('margin-right','-'+rightfix+'px'); $('.siteorigin-panels-stretch').css('padding-left',rightfix+'px'); $('.siteorigin-panels-stretch').css('padding-right',rightfix+'px'); $('body').on('click', '.submitbutton', function(){ var chieudai = $('input[name="chieudai"]').val(); var chieurong = $('input[name="chieurong"]').val(); var sotang = $('input[name="sotang"]').val(); var dttn = parseInt(chieudai) * parseInt(chieurong) * parseInt(sotang) * 4; var dtnt = parseInt(chieudai) * parseInt(chieurong) * parseInt(sotang) * 1.5; $('.dtnt').html(dtnt+" m2"); $('.dttn').html(dttn+" m2"); var matit1 = $('select[name=matit1] option').filter(':selected').val(); var matit2 = $('select[name=matit2] option').filter(':selected').val(); if (chieudai == '' || chieurong == '' || sotang == '') { $(".error").html("Vui lòng điền đẩy đủ và chính xác thông tin!"); } else { if (matit1 == 0) { var thung1 = parseInt(parseInt(dttn) / 50); var sontrang = Math.ceil((parseInt(thung1)*2) / 3); var sonmau = Math.ceil(parseInt(thung1) / 3); $('.s_dttn').html(sontrang+" thùng sơn lót kháng kiềm, "+sonmau+" thùng phủ sơn màu"); } else { var botba = Math.ceil(parseInt(dttn) / 40); var son = parseInt(dttn) / 70; var hangso = parseInt(1); var sontrang = Math.ceil((parseInt(son)*2) / 3); var sonmau = Math.ceil(parseInt(son) / 3); $('.s_dttn').html(botba+" bao bột bả, "+sontrang+" thùng sơn lót kháng kiềm, "+sonmau+" thùng sơn phủ màu"); } if (matit2 == 0) { var chongkiem = Math.ceil(parseInt(dtnt) / 120); var sonmau = parseInt(dtnt) / 120; var sonmaunen = Math.ceil((parseInt(sonmau) * 2) / 3); var sonmauphao = Math.ceil(parseInt(sonmau) / 3); $('.s_dtnt').html(chongkiem+" thùng chống kiềm, "+sonmaunen+" thùng sơn phủ màu, "+sonmauphao+" lon sơn phào chỉ"); } else { var botba = Math.ceil(parseInt(dtnt) / 40); var chongkiem = Math.ceil(parseInt(dtnt) / 240); var sonmau = parseInt(dtnt) / 120; var sonmaunen = Math.ceil((parseInt(sonmau) * 2) / 3); var sonmauphao = Math.ceil(parseInt(sonmau) / 3); $('.s_dtnt').html(botba+" bao bột bả, "+chongkiem+" thùng chống kiềm, "+sonmaunen+" thùng sơn phủ màu, "+sonmauphao+" lon sơn phào ch"); } } }); });