// hash based switcher / tab control // ---------------------------------- // see:https://stackoverflow.com/a/55135471 // see:https://stackoverflow.com/q/51250765 // window.addEventListener("load",function(event){const switcherEl=document.querySelector('.pgwd-restaurant-menus-menus');// .querySelector('.be-uk-tab-menus');/ .getElementById('pgwd-menu-menu-tabs');if (switcherEl !==null){// if not null so no error const anchors=switcherEl.querySelectorAll('li > a');// was 'li > a' / 'a' const switcher=UIkit.switcher(switcherEl);// Show content corresponds to location hash let active=0;while(anchors[active]){if(anchors[active].hash===window.location.hash){switcher.show(active);break}active++}// Update location hash in address bar. switcherEl.addEventListener('click',(event)=>window.location.hash=event.target.hash.substr(1))}});// scroll to anchor on switcher url paramater // see:https://stackoverflow.com/a/31626081 // ----------- // $('#btn').on('click',function(){// $(function (){// var url=window.location.href;// window.location.hash;// var bitAfterHash=url.split('#').pop();// var parts=bitAfterHash.split('/');// var firstPart=parts[0];// var lastPart=parts.pop()=='' ? parts[parts.length - 1]:parts.pop();// $('#extrahash').html(firstPart+' : '+lastPart);//});// Attempt for special menu offscreen animation like huntersmoon /// ---------------- // $(document).ready(function(){// $('.be-nav-scale-effect-wrap-inner').css('height',$(window).height());//});// $(window).resize(function(){// $('.be-nav-scale-effect-wrap-inner').css('height',$(window).height());//});// Format menu prices // ------------------ // removes pound sign only // ---------------------- // $(function (){// $('.menuprice').each(function(i,obj){// // https://stackoverflow.com/a/17169462 // str=$(this).html();// // str=str.replace(/\.00$/,'');// $(this).html(str.replace(/[^0-9\.-]+/g,""));// .00$ for 2 zeros or .0$ for one zero (/\.0$/,'') //});//});// removes pound sign and/or zeros // ----------------------- // $(window).load(function(){// $('.XXmenuprice').each(function(){// // https://stackoverflow.com/a/17169462 // strprice=$(this).html();// // clean it all out - https://stackoverflow.com/a/63862056 // strpricec=Number(strprice.replace(/[^0-9\.-]+/g,""));// $(this).html(strpricec);// // OR to remove ".00" use below. // // https://stackoverflow.com/a/24295147 // // $(this).html(strpricec.replace(/\.0+$/gm,''));// (/\.0$/g,'') OR (/\.0$/,'') //});// //alert("price check");//});