mirror of
https://github.com/seigler/dash-docs
synced 2025-07-27 09:46:12 +00:00
Improve menu design for mobiles
This commit is contained in:
parent
b2f2265454
commit
5ef591369c
3 changed files with 34 additions and 11 deletions
16
js/main.js
16
js/main.js
|
@ -105,6 +105,22 @@ cancelEvent(e);
|
|||
}
|
||||
|
||||
|
||||
function mobilehover(e){
|
||||
//Add a delay before hidding menu for mobiles to prevent accidental clicks
|
||||
var t=getEventTarget(e);
|
||||
while(t.nodeName!='LI'||!t.parentNode.id)t=t.parentNode;
|
||||
var p=t.getElementsByTagName('UL')[0];
|
||||
p.className='hover';
|
||||
setTimeout(function(){
|
||||
for(var i=0,nd=t.parentNode.getElementsByTagName('UL'),n=nd.length;i<n;i++){
|
||||
if(nd[i]==p)continue;
|
||||
nd[i].className='';
|
||||
}
|
||||
},1);
|
||||
cancelEvent(e);
|
||||
}
|
||||
|
||||
|
||||
function boxshow(e){
|
||||
var p=t=getEventTarget(e);
|
||||
while(p.nodeName!='DIV')p=p.parentNode;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue