1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| var main = null, menu = null; var showMenu = false;
mui.plusReady(function() { main = plus.webview.currentWebview(); main.addEventListener('maskClick', closeMenu); setTimeout(function() { menu = mui.preload({ id: 'drag-h5-menu', url: 'drag-h5-menu.html', styles: { left: 0, width: '70%', zindex: -1 }, show: { aniShow: 'none' } }); }, 200); });
function closeMenu() { if(showMenu) { main.setStyle({ mask: 'none', left: 0 }); showMenu = false; menu.hide(); } }
function openMenu() { if(!showMenu) { menu.setStyle({ mask: 'rgba(0,0,0,0)' }); menu.show('none', 0, function() { main.setStyle({ mask: 'rgba(0,0,0,0.4)', left: '70%' }); menu.setStyle({ mask: 'none' }); showMenu = true; }); } }
|