1/* 2// Marquee scroll, Äá»c các thuá»c tÃnh tại : https://github.com/aamirafridi/jQuery.Marquee 3(function(jQuery){jQuery.fn.marquee=function(options){return this.each(function(){var o=jQuery.extend({},jQuery.fn.marquee.defaults,options),jQuerythis=jQuery(this),jQuerymarqueeWrapper,containerWidth,animationCss,verticalDir,elWidth,loopCount=3,playState='animation-play-state',css3AnimationIsSupported=false,_prefixedEvent=function(element,type,callback){var pfx=["webkit","moz","MS","o",""];for(var p=0;p<pfx.length;p++){if(!pfx[p])type=type.toLowerCase();element.addEventListener(pfx[p]+type,callback,false);}},_objToString=function(obj){var tabjson=[];for(var p in obj){if(obj.hasOwnProperty(p)){tabjson.push(p+':'+obj[p]);}} 4tabjson.push();return'{'+tabjson.join(',')+'}';},_startAnimationWithDelay=function(){jQuerythis.timer=setTimeout(animate,o.delayBeforeStart);},methods={pause:function(){if(css3AnimationIsSupported&&o.allowCss3Support){jQuerymarqueeWrapper.css(playState,'paused');}else{if(jQuery.fn.pause){jQuerymarqueeWrapper.pause();}} 5jQuerythis.data('runningStatus','paused');jQuerythis.trigger('paused');},resume:function(){if(css3AnimationIsSupported&&o.allowCss3Support){jQuerymarqueeWrapper.css(playState,'running');}else{if(jQuery.fn.resume){jQuerymarqueeWrapper.resume();}} 6jQuerythis.data('runningStatus','resumed');jQuerythis.trigger('resumed');},toggle:function(){methods[jQuerythis.data('runningStatus')=='resumed'?'pause':'resume']();},destroy:function(){clearTimeout(jQuerythis.timer);jQuerythis.find("*").addBack().unbind();jQuerythis.html(jQuerythis.find('.js-marquee:first').html());}};if(typeof options==='string'){if(jQuery.isFunction(methods[options])){if(!jQuerymarqueeWrapper){jQuerymarqueeWrapper=jQuerythis.find('.js-marquee-wrapper');} 7if(jQuerythis.data('css3AnimationIsSupported')===true){css3AnimationIsSupported=true;} 8methods[options]();} 9return;} 10var dataAttributes={},attr;jQuery.each(o,function(key,value){attr=jQuerythis.attr('data-'+key);if(typeof attr!=='undefined'){switch(attr){case'true':attr=true;break;case'false':attr=false;break;} 11o[key]=attr;}});if(o.speed){o.duration=parseInt(jQuerythis.width(),10)/o.speed*1000;} 12verticalDir=o.direction=='up'||o.direction=='down';o.gap=o.duplicated?parseInt(o.gap):0;jQuerythis.wrapInner('<div class="js-marquee"></div>');var jQueryel=jQuerythis.find('.js-marquee').css({'margin-right':o.gap,'float':'left'});if(o.duplicated){jQueryel.clone(true).appendTo(jQuerythis);} 13jQuerythis.wrapInner('<div style="width:10000px;" class="js-marquee-wrapper"></div>');jQuerythis.css({'overflow':'hidden','width':'100%'});jQuerymarqueeWrapper=jQuerythis.find('.js-marquee-wrapper');if(verticalDir){var containerHeight=jQuerythis.height();jQuerymarqueeWrapper.removeAttr('style');jQuerythis.height(containerHeight);jQuerythis.find('.js-marquee').css({'float':'none','margin-bottom':o.gap,'margin-right':0});if(o.duplicated)jQuerythis.find('.js-marquee:last').css({'margin-bottom':0});var elHeight=jQuerythis.find('.js-marquee:first').height()+o.gap;if(o.startVisible&&!o.duplicated){o._completeDuration=((parseInt(elHeight,10)+parseInt(containerHeight,10))/parseInt(containerHeight,10))*o.duration;o.duration=(parseInt(elHeight,10)/parseInt(containerHeight,10))*o.duration;}else{o.duration=((parseInt(elHeight,10)+parseInt(containerHeight,10))/parseInt(containerHeight,10))*o.duration;}}else{elWidth=jQuerythis.find('.js-marquee:first').width()+o.gap;containerWidth=jQuerythis.width();if(o.startVisible&&!o.duplicated){o._completeDuration=((parseInt(elWidth,10)+parseInt(containerWidth,10))/parseInt(containerWidth,10))*o.duration;o.duration=(parseInt(elWidth,10)/parseInt(containerWidth,10))*o.duration;}else{o.duration=((parseInt(elWidth,10)+parseInt(containerWidth,10))/parseInt(containerWidth,10))*o.duration;}} 14if(o.duplicated){o.duration=o.duration/2;} 15if(o.allowCss3Support){var 16elm=document.body||document.createElement('div'),animationName='marqueeAnimation-'+Math.floor(Math.random()*10000000),domPrefixes='Webkit Moz O ms Khtml'.split(' '),animationString='animation',animationCss3Str='',keyframeString='';
16if(elm.style.animation!==undefined){keyframeString='@keyframes '+animationName+' ';css3AnimationIsSupported=true;} 17if(css3AnimationIsSupported===false){for(var i=0;i<domPrefixes.length;i++){if(elm.style[domPrefixes[i]+'AnimationName']!==undefined){var prefix='-'+domPrefixes[i].toLowerCase()+'-';animationString=prefix+animationString;playState=prefix+playState;keyframeString='@'+prefix+'keyframes '+animationName+' ';css3AnimationIsSupported=true;break;}}} 18if(css3AnimationIsSupported){animationCss3Str=animationName+' '+o.duration/1000+'s '+o.delayBeforeStart/1000+'s infinite '+o.css3easing;jQuerythis.data('css3AnimationIsSupported',true);}} 19var _rePositionVertically=function(){jQuerymarqueeWrapper.css('transform','translateY('+(o.direction=='up'?containerHeight+'px':'-'+elHeight+'px')+')');},_rePositionHorizontally=function(){jQuerymarqueeWrapper.css('transform','translateX('+(o.direction=='left'?containerWidth+'px':'-'+elWidth+'px')+')');};if(o.duplicated){if(verticalDir){if(o.startVisible){jQuerymarqueeWrapper.css('transform','translateY(0)');}else{jQuerymarqueeWrapper.css('transform','translateY('+(o.direction=='up'?containerHeight+'px':'-'+((elHeight*2)-o.gap)+'px')+')');}}else{if(o.startVisible){jQuerymarqueeWrapper.css('transform','translateX(0)');}else{jQuerymarqueeWrapper.css('transform','translateX('+(o.direction=='left'?containerWidth+'px':'-'+((elWidth*2)-o.gap)+'px')+')');}} 20if(!o.startVisible){loopCount=1;}}else if(o.startVisible){loopCount=2;}else{if(verticalDir){_rePositionVertically();}else{_rePositionHorizontally();}} 21var animate=function(){if(o.duplicated){if(loopCount===1){o._originalDuration=o.duration;if(verticalDir){o.duration=o.direction=='up'?o.duration+(containerHeight/((elHeight)/o.duration)):o.duration*2;}else{o.duration=o.direction=='left'?o.duration+(containerWidth/((elWidth)/o.duration)):o.duration*2;} 22if(animationCss3Str){animationCss3Str=animationName+' '+o.duration/1000+'s '+o.delayBeforeStart/1000+'s '+o.css3easing;} 23loopCount++;} 24else if(loopCount===2){o.duration=o._originalDuration;if(animationCss3Str){animationName=animationName+'0';keyframeString=jQuery.trim(keyframeString)+'0 ';animationCss3Str=animationName+' '+o.duration/1000+'s 0s infinite '+o.css3easing;} 25loopCount++;}} 26if(verticalDir){if(o.duplicated){if(loopCount>2){jQuerymarqueeWrapper.css('transform','translateY('+(o.direction=='up'?0:'-'+elHeight+'px')+')');} 27animationCss={'transform':'translateY('+(o.direction=='up'?'-'+elHeight+'px':0)+')'};}else if(o.startVisible){if(loopCount===2){if(animationCss3Str){animationCss3Str=animationName+' '+o.duration/1000+'s '+o.delayBeforeStart/1000+'s '+o.css3easing;} 28animationCss={'transform':'translateY('+(o.direction=='up'?'-'+elHeight+'px':containerHeight+'px')+')'};loopCount++;}else if(loopCount===3){o.duration=o._completeDuration;if(animationCss3Str){animationName=animationName+'0';keyframeString=jQuery.trim(keyframeString)+'0 ';animationCss3Str=animationName+' '+o.duration/1000+'s 0s infinite '+o.css3easing;} 29_rePositionVertically();}}else{_rePositionVertically();animationCss={'transform':'translateY('+(o.direction=='up'?'-'+(jQuerymarqueeWrapper.height())+'px':containerHeight+'px')+')'};}}else{if(o.duplicated){if(loopCount>2){jQuerymarqueeWrapper.css('transform','translateX('+(o.direction=='left'?0:'-'+elWidth+'px')+')');} 30animationCss={'transform':'translateX('+(o.direction=='left'?'-'+elWidth+'px':0)+')'};}else if(o.startVisible){if(loopCount===2){if(animationCss3Str){animationCss3Str=animationName+' '+o.duration/1000+'s '+o.delayBeforeStart/1000+'s '+o.css3easing;} 31animationCss={'transform':'translateX('+(o.direction=='left'?'-'+elWidth+'px':containerWidth+'px')+')'};loopCount++;}else if(loopCount===3){o.duration=o._completeDuration;if(animationCss3Str){animationName=animationName+'0';keyframeString=jQuery.trim(keyframeString)+'0 ';animationCss3Str=animationName+' '+o.duration/1000+'s 0s infinite '+o.css3easing;} 32_rePositionHorizontally();}}else{_rePositionHorizontally();animationCss={'transform':'translateX('+(o.direction=='left'?'-'+elWidth+'px':containerWidth+'px')+')'};}} 33jQuerythis.trigger('beforeStarting');
33if(css3AnimationIsSupported){jQuerymarqueeWrapper.css(animationString,animationCss3Str);var keyframeCss=keyframeString+' { 100% '+_objToString(animationCss)+'}',jQuerystyles=jQuerymarqueeWrapper.find('style');if(jQuerystyles.length!==0){jQuerystyles.filter(":last").html(keyframeCss);}else{jQuery('head').append('<style>'+keyframeCss+'</style>');} 34_prefixedEvent(jQuerymarqueeWrapper[0],"AnimationIteration",function(){jQuerythis.trigger('finished');});_prefixedEvent(jQuerymarqueeWrapper[0],"AnimationEnd",function(){animate();jQuerythis.trigger('finished');});}else{jQuerymarqueeWrapper.animate(animationCss,o.duration,o.easing,function(){jQuerythis.trigger('finished');if(o.pauseOnCycle){_startAnimationWithDelay();}else{animate();}});} 35jQuerythis.data('runningStatus','resumed');};jQuerythis.bind('pause',methods.pause);jQuerythis.bind('resume',methods.resume);if(o.pauseOnHover){jQuerythis.bind('mouseenter',methods.pause);jQuerythis.bind('mouseleave',methods.resume);} 36if(css3AnimationIsSupported&&o.allowCss3Support){animate();}else{_startAnimationWithDelay();}});};jQuery.fn.marquee.defaults={allowCss3Support:true,css3easing:'linear',easing:'linear',delayBeforeStart:1000,direction:'left',duplicated:false,duration:5000,gap:20,pauseOnCycle:false,pauseOnHover:false,startVisible:false};})(jQuery); 37 */ 38function GoBackWithRefresh(event){if('referrer'in document){window.location=document.referrer;}else{window.history.back();}} 39// Start quick cart 40jQuery('.addtocart-bar i').click(function(){jQuery(this).next().click();});jQuery('input.flytocart-button').click(function(){jQuery('.Bquickcart').hide();jQuery('.reloadquickcart i').css('display','inline-block');alert('Sản phẩm Äã ÄÆ°á»£c thêm và o giá» hà ng');});var url_cart='index.php?option=com_users&view=login';function thaydoisoluong(id,soluong){jQuery('.n1').children().attr("disabled",true);if(soluong>0){} 41else{soluong=0;jQuery('.spitem[data-id="'+id+'"]').remove();} 42jQuery('.z2').html('<i class="fa fa-spinner cart_spiners" style="display:inline-block;"></i>');jQuery.ajax({type:'POST',url:'',data:{option:'com_virtuemart',quantity:soluong,view:'cart',task:'update',cart_virtuemart_product_id:id,},dataType:'html',success:function(data){jQuery('.z2').load(url_cart+' .z2_trong',function(){jQuery('.Bquickcart').each(function(){var ul=url_cart+' .Bquickcart[data-cart="'+jQuery(this).attr('data-cart')+'"] .cart_dropdown_trong';jQuery(this).find('.cart_dropdown').load(ul,function(){jQuery('.n1').children().attr("disabled",false);});});});},error:function(){alert('thatbai');}});} 43function start(){jQuery('.n1 input').change(function(){thaydoisoluong(jQuery(this).parent().attr('data-id'),parseInt(jQuery(this).val()));});jQuery('.n1_1').click(function(){jQuery(this).parent().find('input').val(parseInt(jQuery(this).parent().find('input').val())-1);thaydoisoluong(jQuery(this).parent().attr('data-id'),parseInt(jQuery(this).parent().find('input').val()));});jQuery('.n1_3').click(function(){jQuery(this).parent().find('input').val(parseInt(jQuery(this).parent().find('input').val())+1);thaydoisoluong(jQuery(this).parent().attr('data-id'),parseInt(jQuery(this).parent().find('input').val()));});jQuery('.cart_dropdown').click(function(){jQuery('.popup_cart').addClass('inpop3');jQuery('.popup_cart_nentat').addClass('inpop3');jQuery('html').addClass('scrollhidden');});jQuery('.popup_cart_close').click(function(){jQuery('.inpop3').removeClass('inpop3');jQuery('html').removeClass('scrollhidden');});jQuery('.popup_cart_nentat').click(function(){jQuery('.popup_cart_close').click();});} 44function checkcart(dem){if(dem>=jQuery('.Bquickcart').length){start();}} 45function QuickCartLoad(){var dem=0;jQuery('.Bquickcart').each(function(){var ul=url_cart+' .Bquickcart[data-cart="'+jQuery(this).attr('data-cart')+'"] .Bquickcart_trong';jQuery(this).load(ul,function(){jQuery(this).removeAttr('style');jQuery(this).next().find('.cart_spiners').removeAttr('style');dem+=1;checkcart(dem);});});} 46function LoadCartAndCounter(){if(jQuery('.Bquickcart').hasClass('Bquickcart')||jQuery('.mt_visitcounter').hasClass('mt_visitcounter')){var tempoBim=jQuery('<div/>');tempoBim.load(url_cart+' .Bquickcart, .mt_visitcounter',function(data){tempoBim=jQuery(jQuery.parseHTML(data));if(jQuery('.Bquickcart').hasClass('Bquickcart')){jQuery('.Bquickcart').html(tempoBim.find('.Bquickcart_trong').html());jQuery('.Bquickcart').removeAttr('style');jQuery('.reloadquickcart .cart_spiners').removeAttr('style');start();} 47if(jQuery('.mt_visitcounter').hasClass('mt_visitcounter')){jQuery('.mt_visitcounter_trong').html(tempoBim.find('.mt_visitcounter_trong .vis_table').html());jQuery('.mt_visitcounter_trong .vis_table').css('visibility','visible');jQuery('.reloadvis').hide();}});}} 48setTimeout(function(){ 49 LoadCartAndCounter(); 50},100); 51// End quick cart 52// Thà nh viên 53function myValidator(f,t){f.task.value=t;if(document.formvalidator.isValid(f)){var flag=true;var txt='';if(jQuery('#password_field').val()==jQuery('#password2_field').val()){} 54else{flag=false;txt+='Máºt khẩu lần 1 và máºt khẩu lần 2 không trùng nhau !\n';} 55if(jQuery('#email_field').val().indexOf('@')>-1&&jQuery('#email_field').val().indexOf('.')>-1){} 56else{flag=false;txt+='Chưa nháºp Äúng email !\n';} 57var sodt=jQuery.trim(jQuery('#phone_1_field').val());if((jQuery.isNumeric(parseInt(sodt))||jQuery.isNumeric(parseInt(sodt.substring(1))))&&sodt.length>8&&sodt.length<13){} 58else{flag=false;txt+='Chưa nháºp Äúng sá» Äiá»n thoại !';} 59if(flag){return false;}else{alert(txt);}}else{var msg="<?php echo addslashes( JText::_('COM_VIRTUEMART_USER_FORM_MISSING_REQUIRED_JS') ); ?>";alert(msg);} 60return false;} 61jQuery(document).ready(function(){function checkStrength(passcheck,strengthMessage){var strength=0 62if(passcheck.length<8){strengthMessage.removeClass();strengthMessage.addClass('Short');strengthMessage.text('Too short');return false;} 63if(passcheck.length>7) 64strength+=1;if(passcheck.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) 65strength+=1;if(passcheck.match(/([a-zA-Z])/)&&passcheck.match(/([0-9])/)) 66strength+=1;if(passcheck.match(/([!,%,&,@,#,jQuery,^,*,?,_,~])/)) 67strength+=1;if(passcheck.match(/(.*[!,%,&,@,#,jQuery,^,*,?,_,~].*[!,%,&,@,#,jQuery,^,*,?,_,~])/)) 68strength+=1;if(strength<2){strengthMessage.removeClass();strengthMessage.addClass('Weak');strengthMessage.text('Weak');return false;}else if(strength==2){strengthMessage.removeClass();strengthMessage.addClass('Good');strengthMessage.text('Good');return false;}else{strengthMessage.removeClass();strengthMessage.addClass('Strong');strengthMessage.text('Strong');}} 69jQuery('#password_field').keyup(function(){checkStrength(jQuery(this).val(),jQuery(this).next().find('#strengthMessage'));});function CheckUserName(str){if(/^[a-zA-Z0-9- ]*$/.test(str)==false){return false;} 70if(str.indexOf(' ')>-1){return false;} 71return true;} 72jQuery('.ButtonDangKy').click(function(){var dataform=jQuery(this).attr('data-form');if(dataform=='dangky'){var fom=jQuery(this).parent().parent();}else{var fom=jQuery(this).parent().parent().parent().parent();} 73var flag=true;var txt='';fom.find('.required').each(function(){if(jQuery(this).val().trim()==''||jQuery(this).val().trim()==' '){jQuery(this).addClass('invalid');flag=false;}else{jQuery(this).removeClass('invalid');}});if(dataform=='dangky'){fom.find('#password_field, #password2_field').each(function(){if(jQuery(this).val().trim()==''||jQuery(this).val().trim()==' '){jQuery(this).addClass('invalid');flag=false;}else{jQuery(this).removeClass('invalid');}});}
74if(!flag){alert('Chưa nháºp Äá»§ các trưá»ng yêu cầu !');return false;} 75if(fom.find('#username_field').val().length>=3&&CheckUserName(fom.find('#username_field').val())){fom.find('#username_field').removeClass('invalid');}else{flag=false;txt+='Tên tà i khoản phải có Äá» dà i từ 3 ký tá»± và không chứa ký tá»± Äặc biá»t !\n';fom.find('#username_field').addClass('invalid');} 76if(fom.find('#email_field').val().indexOf('@')>-1&&fom.find('#email_field').val().indexOf('.')>-1){} 77else{flag=false;txt+='Chưa nháºp Äúng email !\n';} 78var sodt=fom.find('#phone_1_field').val().trim();if((jQuery.isNumeric(parseInt(sodt))||jQuery.isNumeric(parseInt(sodt.substring(1))))&&sodt.length>8&&sodt.length<13){} 79else{flag=false;txt+='Chưa nháºp Äúng sá» Äiá»n thoại !';} 80if(fom.find('#password_field').val()!=fom.find('#password2_field').val()){flag=false;txt+='Máºt khẩu lần 1 và máºt khẩu lần 2 không trùng nhau !\n';fom.find('#password_field, #password2_field').addClass('invalid');}else{fom.find('#password_field, #password2_field').removeClass('invalid');} 81if(flag){if(dataform=='dangky'){fom.find('#name_field').val(fom.find('#username_field').val());} 82fom.submit();}else{alert(txt);}});jQuery('#PasswordBlock .fa-key').click(function(){var randomP=Math.random().toString(12).slice(-8);jQuery(this).parent().find('#randomPassword').text(randomP);jQuery(this).parent().parent().parent().parent().parent().parent().find('#password_field, #password2_field').val(randomP);checkStrength(randomP,jQuery(this).parent().find('#strengthMessage'));var jQuerytemp=jQuery("<input>");jQuery("body").append(jQuerytemp);jQuerytemp.val(randomP).select();document.execCommand("copy");jQuerytemp.remove();});jQuery('.formdndk_1 li').click(function(){if(jQuery(this).attr('data-tab')==9){jQuery('.formdndk_2_9 .nutlogout').click();} 83else{jQuery('.formdndk_1 li.ON').removeClass('ON');jQuery(this).addClass('ON');jQuery('.formdndk_2>div.ON').removeClass('ON');jQuery('.formdndk_2>div[data-tab="'+jQuery(this).attr('data-tab')+'"]').addClass('ON');}});}); 84// End thà nh viên 85jQuery(document).ready(function ($) { 86 // Fetch Video Tag Mobile 87 function detectMob(){const toMatch=[/Android/i,/webOS/i,/iPhone/i,/iPad/i,/iPod/i,/BlackBerry/i,/Windows Phone/i];return toMatch.some((toMatchItem)=>{return navigator.userAgent.match(toMatchItem);});} 88 if(detectMob()){var myVideo=document.getElementsByTagName('video');for(let i=0;i<myVideo.length;i++){myVideo[i].muted=true;myVideo[i].autoplay=true;}} 89 // End Fetch Video Tag 90 if($('.thanhvienpage').hasClass('thanhvienpage')){if($.trim($('.errorclass').text())){$('.errorclass').show();}} 91 $('.main-image').mouseenter(function(){$('.main-image').mousemove(function(e){$(this).find('img').css({'transform-origin':((e.pageX-$(this).offset().left)/$(this).width())*100+'% '+((e.pageY-$(this).offset().top)/$(this).height())*100+'%'});});});$('.vm-button-correct').click(function(){$(this).hide();$('.cart_spiners').css('display','inline-block');});$('.sp-vmsearch-categories').each(function(){$(this).children().first().attr('selected',true)});if($('.rsform').hasClass('rsform')){$('.rsform').each(function(){$(this).find('.rsform-input-box').each(function(){if(typeof $(this).attr('placeholder')!==typeof undefined&&$(this).attr('placeholder')!==false){} 92 else{$(this).attr('placeholder',$(this).parent().parent().parent().find('.formControlLabel').text());}});$(this).find('.rsform-text-box').each(function(){if(typeof $(this).attr('placeholder')!==typeof undefined&&$(this).attr('placeholder')!==false){} 93 else{$(this).attr('placeholder',$(this).parent().parent().parent().find('.formControlLabel').text());}});});} 94 $('.rsform-button').click(function(){var cf=true;$(this).parent().parent().parent().parent().parent().find('input[type="text"]').each(function(){if($(this).val()==''&&$(this).attr('data-required')=='YES'){$(this).addClass('rsform-error');cf=false;}else{$(this).removeClass('rsform-error');}});$(this).parent().parent().parent().parent().parent().find('textarea').each(function(){if($(this).val()==''&&$(this).attr('data-required')=='YES'){$(this).addClass('rsform-error');cf=false;}else{$(this).removeClass('rsform-error');}});if(cf){var doituong='.'+$(this).attr('data-form');$(this).val('Gá»i thà nh công');$(doituong).submit();}});
94function convertNumberToCurrency(tienmoi){tienmoi=parseFloat($('.header-product .product-thongtin-salesPrice').attr('data-price'))+parseFloat(tienmoi);if($('.header-product .product-thongtin-salesPrice').attr('data-currency-id')==144){tienmoi=parseFloat(tienmoi).toFixed(2);tienmoi=tienmoi.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1,");tienmoi=$('.header-product .product-thongtin-salesPrice').attr('data-currency')+tienmoi;}else{tienmoi=parseInt(tienmoi);tienmoi=tienmoi.toString().replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1.");tienmoi=tienmoi+' '+$('.header-product .product-thongtin-salesPrice').attr('data-currency');} 95 $('.header-product .product-thongtin-salesPrice').text(tienmoi);} 96 $('.header-product .product-field-display select').change(function(){var giatien=0;$('.header-product .product-field-display select').each(function(){if($.isNumeric($(this).find('option:selected').attr('data-price'))){giatien=giatien+parseFloat($(this).find('option:selected').attr('data-price'));}});convertNumberToCurrency(giatien);});$('.header-product .product-field-display select').each(function(){$(this).change();});function changeRadioBim(){var giatien=0;$('.header-product .product-field-display .RadioBim').each(function(){if($.isNumeric($(this).find('input:checked').attr('data-price'))){giatien=giatien+parseFloat($(this).find('input:checked').attr('data-price'));}});convertNumberToCurrency(giatien);} 97 $('.header-product .product-field-display .RadioBim input').change(function(){changeRadioBim();});$('.header-product .product-field-display .RadioBim span').click(function(){$(this).parent().find('input').removeAttr('checked');$(this).find('input').attr('checked',true);$(this).parent().find('.CheckRadio').removeClass('CheckRadio');$(this).addClass('CheckRadio');changeRadioBim();});$(window).load(function(){setTimeout(function(){$('iframe[data-src]').each(function(){$(this).attr('src',$(this).attr('data-src'));});$('script[data-src]').each(function(){$(this).attr('src',$(this).attr('data-src'));});},3000);});$('.arcontactus-message-button').click(function(){if($(this).children('.static').hasClass('hide')){$(this).children('.static').removeClass('hide');$(this).find('.arcontactus-close').removeClass('show-messageners-block');$(this).parent().find('.messangers-block.lg').removeClass('show-messageners-block');}else{$(this).children('.static').addClass('hide');$(this).find('.arcontactus-close').addClass('show-messageners-block');$(this).parent().find('.messangers-block.lg').addClass('show-messageners-block');}}); 98 $('.Pagination_Short select').change(function(){if($(this).find('option:selected').hasClass('pagi-active')){} 99 else{window.location.replace($(this).find('option:selected').attr('data-redirect'));}}); 100 /* 101 // Báºt marquee demo 102 $('.browse-view .row').marquee({ 103 duplicated: true, 104 pauseOnHover :true, 105 startVisible :true, 106 speed :80, 107 gap :0, 108 }); 109 */ 110 /* 111 // Chuyá»n input text thà nh input date vá»i datepicker 112 // chèn thẻ html : <input class="inpit-datetime" type="text"> 113 // Chuyá»n thà nh datepicker 114 $( '.input-datetime' ).each(function(){ 115 $(this).datepicker({ 116 changeMonth: true, 117 changeYear: true, 118 dateFormat: 'dd/mm/yy' 119 }); 120 }); 121 // Chuyá»n thà nh date picker nhưng giữ nguyên value cÅ© 122 $( '.input-datetime' ).each(function(){ 123 var dbDate = $(this).val(); 124 dbDate = dbDate.substring(dbDate.length - 4,dbDate.length) + '/' + dbDate.substring(3,5) + '/' + dbDate.substring(0,2); 125 var date2 = new Date(dbDate); 126 $(this).datepicker({ 127 changeMonth: true, 128 changeYear: true, 129 dateFormat: 'dd/mm/yy' 130 }).datepicker('setDate', date2); 131 }); 132 */ 133 /* Owl Carousel ( nhá» display:none Äá»i tượng muá»n gá»i Owl Carousel trong file template.css 134 $('.noidungduoi1 #itemListLeading, .footer2 .main2').addClass("owl-carousel owl-theme"); 135 $('.owl-carousel').each(function(stt){ 136 var me = $(this); 137 if( stt == 0 ){ 138 // Scroll nguyên container, khi sá» dụng ÄÆ°á»£c autoplay 139 $(this).owlCarousel({ 140 slideSpeed: 1000, 141 dots:false, 142 margin:20, 143 loop: true, 144 stagePadding:0, 145 stopOnHover:true, 146 nav:true, 147 smartSpeed:1000, 148 scrollPerPage: true, 149 responsive:{ 150 0:{ 151 items:2, 152 slideBy:2, 153 nav:true 154 }, 155 767:{ 156 items:4, 157 slideBy:4, 158 nav:true 159 }, 160 1024:{ 161 items:6, 162 slideBy:6, 163 nav:true 164 165 } 166 }, 167 onInitialized: me.show() 168 }); 169 } 170 else{ 171 // Scroll từng block, có thá» autoplay Äá» scroll 172 $(this).owlCarousel({ 173 slideSpeed: 1000, 174 dots:false, 175 loop:true, 176 autoplayTimeout:10000, 177 autoplay:true, 178 margin:20, 179 stagePadding:0, 180 stopOnHover:true, 181 nav:true, 182 smartSpeed:1000, 183 responsive:{ 184 0:{ 185 items:2, 186 nav:true 187 }, 188 767:{ 189 items:4, 190 nav:true 191 }, 192 1024:{ 193 items:6, 194 nav:true 195 } 196 }, 197 onInitialized: me.show() 198 }); 199 } 200 }); 201 End Owl Carousel */ 202 if( $('[data-fancybox]').length > 0 ){ 203 $.fancybox.defaults.hash = false; // Tắt chức nÄng tá»± Äá»i url cá»§a fancybox 204 setTimeout(function(){ 205 $('[data-fancybox]').fancybox({ 206 closeExisting: true, 207 loop: true, 208 backFocus: false, 209 autoFocus: false, 210 afterClose: function () { 211 212 }, 213 //buttons : [ "zoom", "share", "fullScreen", "download", "thumbs", "close" ] 214 }); 215 },100); 216 } 217 /* 218 Muá»n sá» dụng fancybox trên web chá» viá»c chèn: 219 <a href="link_anh_1" data-fancybox="gallery"><img src="link_anh_1"></a> 220 <a href="link_anh_2" data-fancybox="gallery"><img src="link_anh_2"></a> 221 Value có tên gallery là Äá» nhóm các ảnh nà y và o chung 1 group khi popup lên, nếu có 2 group: 222 <div class="group1"> 223 a href="link_anh_1" data-fancybox="gallery_group_1"><img src="link_anh_1"></a> 224 <a href="link_anh_2" data-fancybox="gallery_group_1"><img src="link_anh_2"></a> 225 </div> 226 <div class="group2"> 227 <a href="link_anh_3" data-fancybox="gallery_group_2"><img src="link_anh_3"></a> 228 <a href="link_anh_4" data-fancybox="gallery_group_2"><img src="link_anh_4"></a> 229 </div> 230 Nếu ko show ảnh thumb có thá» sá» dụng: 231 <a href="link_anh_1" data-fancybox="gallery">Xem ảnh</a> 232 Nếu dùng iframe youtube cứ chèn như thông thưá»ng fancybox tá»± hiá»u iframe: 233 <a data-fancybox="video-gallery" href="https://www.youtube.com/watch?v=z2X2HaTvkl8">[ảnh hoặc text]</a> 234 */ 235 236 // Scroll top cho chức nÄng MỤC LỤC nếu trên website có CSS thà nh phần position fixed thì Äặt giá trá» chieu_cao_position_fixed bằng chiá»u cao các thà nh phần fixed 237 var chieu_cao_position_fixed = 0; 238 function GetPositionHeightHasTag(){var hash_tag=window.location.hash.replace('#','');hash_tag=$('*[ez-toc-data-id="'+hash_tag+'"]').offset().top;return hash_tag;} 239 var mhie=$('.MTTableContent_Menu').height();$('.MTTable_title').click(function(){if($(this).parent().hasClass('MTL_show')){$(this).parent().removeClass('MTL_show');$(this).parent().addClass('MTL_hide');$(this).parent().find('.MTTableContent_Menu').animate({height:0},300);}else{$(this).parent().removeClass('MTL_hide');$(this).parent().addClass('MTL_show');$(this).parent().find('.MTTableContent_Menu').animate({height:mhie},300);}});if(window.location.hash.length>0){var hash_tag_height=GetPositionHeightHasTag();$('html, body').animate({scrollTop:hash_tag_height-chieu_cao_position_fixed},300);} 240 $('.MTTableContent_Menu a').click(function(){var idx_chose=$(this).attr('data-toc-id');var scrtop=$('*[ez-toc-data-id="'+idx_chose+'"]').offset().top;$('html, body').animate({scrollTop:scrtop-chieu_cao_position_fixed},300);});window.onbeforeunload=function(){if(window.location.hash.length>0){var hash_tag_height=GetPositionHeightHasTag();window.scrollTo(0,hash_tag_height-chieu_cao_position_fixed);}} 241 242 // Code jQuery viết tiếp á» Äây 243 $('.extra2 .row').addClass("owl-carousel owl-theme"); 244 $('.owl-carousel').each(function(stt){ 245 var me = $(this); 246 if( stt == 0 || stt == 1 || stt == 2 || stt == 3 || stt == 4 || stt == 5 ){ 247 $(this).owlCarousel({ 248 animateOut: 'slideOutLeft', 249 animateIn: 'slideInRight', 250 slideSpeed: 500, 251 dots:false, 252 loop:true, 253 autoplayTimeout:10000, 254 autoplay:true, 255 margin:20, 256 stagePadding:0, 257 stopOnHover:true, 258 nav:true, 259 smartSpeed:2000, 260 responsive:{ 261 0:{ 262 items:1, 263 nav:true 264 }, 265 767:{ 266 items:1, 267 nav:true 268 }, 269 1024:{ 270 items:3, 271 nav:true 272 } 273 }, 274 onInitialized: me.show() 275 }); 276 } 277 }); 278 $('.extra4 #itemListLeading').addClass("owl-carousel owl-theme"); 279 $('.owl-carousel').each(function(stt){ 280 var me = $(this); 281 if( stt == 0 || stt == 1 || stt == 2 || stt == 3 || stt == 4 || stt == 5 || stt == 6 ){ 282 $(this).owlCarousel({ 283 animateOut: 'slideOutLeft', 284 animateIn: 'slideInRight', 285 slideSpeed: 500, 286 dots:false, 287 loop:true, 288 autoplayTimeout:10000, 289 autoplay:true, 290 margin:20, 291 stagePadding:0, 292 stopOnHover:true, 293 nav:true, 294 smartSpeed:2000, 295 responsive:{ 296 0:{ 297 items:1, 298 nav:true 299 }, 300 767:{ 301 items:1, 302 nav:true 303 }, 304 1024:{ 305 items:4, 306 nav:true 307 } 308 }, 309 onInitialized: me.show() 310 }); 311 } 312 }); 313 $('.extra7 #itemListLeading').addClass("owl-carousel owl-theme"); 314 $('.owl-carousel').each(function(stt){ 315 var me = $(this); 316 if( stt == 0 || stt == 1 ){ 317 $(this).owlCarousel({ 318 animateOut: 'slideOutLeft', 319 animateIn: 'slideInRight', 320 slideSpeed: 500, 321 dots:false, 322 loop:true, 323 autoplayTimeout:10000, 324 autoplay:true, 325 margin:20, 326 stagePadding:0, 327 stopOnHover:true, 328 nav:true, 329 smartSpeed:2000, 330 responsive:{ 331 0:{ 332 items:1, 333 nav:true 334 }, 335 767:{ 336 items:1, 337 nav:true 338 }, 339 1024:{ 340 items:4, 341 nav:true 342 } 343 }, 344 onInitialized: me.show() 345 }); 346 } 347 });
348 ////////////////////////////////////////////////////////////// 349 $('.extra2 .main2').prepend("<div class='tab'></div>"); 350 $('.extra2 .ja-workshome').each(function() { 351 var id1 = $(this).attr('id'); 352 var title = $(this).find('.workshome-title').text(); 353 $(this).parent().find('.tab').append('<a href="#' + id1 + '">' + title); 354 //$(this).prepend('<a href="#'+id1+'">'+title); 355 }); 356 //$('.noidungtren1 .ja-workshome > a ').clone().prependTo('.tab'); 357 //$('.noidungtren1 .ja-workshome > a ').remove(); 358 $(".tab a").click(function(e) { 359 e.preventDefault(); 360 $(this).addClass("current"); 361 $(this).siblings().removeClass("current"); 362 var tabhref = $(this).attr("href"); 363 $(".extra2 .ja-workshome").not(tabhref).css('display', 'none'); 364 $(tabhref).fadeIn(); 365 }); 366 $('.tab > a:first-child').click(); 367 368 $(function() { 369 $(window).scroll(function() { 370 if ($(this).scrollTop() > 100) 371 $(".lentop").fadeIn(); 372 else 373 $(".lentop").fadeOut(); 374 }); 375 $(".lentop").click(function() { 376 $("body,html").animate({ 377 scrollTop: 0 378 }, "slow"); 379 }); 380 }); 381 $(window).scroll(function() { 382 if ($(window).scrollTop() >= 60) { 383 $("#ja-menungang").addClass("fixed"); 384 } else { 385 386 $("#ja-menungang").removeClass("fixed"); 387 } 388 }); 389 390 391 392 $('#Mod427').hide(); 393 $('#Mod424 .dangky').click(function() { 394 $('#Mod427,#Mod428').toggle(); 395 }); 396 $("#Mod427").append("<span> </span>"); 397 $("#Mod427 span,#Mod428").click(function() { 398 $('#Mod427,#Mod428').hide(); 399 $('.nentat1').hide(); 400 }); 401 402 403 404/* $(".rsform-block.rsform-block-date").attr("dd/mm/yy"); */
vendor: 4 bytes, line 405
405});
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.