Want to consult bosses, about this type of navigation have any code to share, and then explain, let me learning how to learn, thank you for your bosses
CodePudding user response:
Default hidden div mouse-over display, use the position to do
CodePudding user response:
reference 1st floor jio can reply: default hidden div mouse-over shows that using the position do locate Ok, I just dig me, thank you CodePudding user response:
The display screen space occupied not Block according to None hidden Screen space occupied the visibility The visible display Hidden hidden Screen space occupied opcity 1 0 hidden CodePudding user response:
Js: v - show v - if CSS: the display CodePudding user response:
quoted li pond reply: 3/f display screen space occupied not Block according to None hidden Screen space occupied the visibility The visible display Hidden hidden Screen space occupied opcity 1 0 hidden Bosses, I just dig in for a day, just dig out, could you please take time to write a simple code? Let me have idea, CodePudding user response:
The reference 4 floor wzh970514 reply: js: v - show v - if CSS: display I wrote a day, don't know how to separate the "ask" with the following list, also don't know how to set up the mouse in good q on display, js is learning, CSS don't come out to write a simple code trouble bosses make me familiar with the can CodePudding user response:
<meta charset="utf-8" & gt; Mouse-over menu appears secondary & lt;/title & gt; <style> A { color: #fff; text-decoration: none; } Ul { margin: 0; list-style: none; } # menu { Width: 500 px; Height: 60 px; Background: slategray; border-radius: 6px; Box - shadow: 2 p 2 p 5 px snow; } # menu li { float: left; Margin - top: 10 px; line-height: 22px; padding: 0; position: relative; } # menu li a { Padding: 10 px 20 px; display: inline-block; } # menu li. Lis { width: 300px; height: 40px; line-height: 40px; Border - the radius: 5 px; Background: lightblue; position: absolute; Top: 70 px; } # menu li. Lis a { Padding: 0 px; Background: none; Opacity: 1; color: #fff; } # menu li. Lis a: hover { text-decoration: underline; } </style> <script> Window. The onl oad=function () { Var oUl=document. GetElementById (" menu "); Var. ALi=oUl getElementsByTagName (" li "); Var aDiv=oUl. GetElementsByTagName (' div '); Var timer=null; For (var I=0; i Var oA=aLi [I] getElementsByTagName (' a ') [0]; OA. The index=I; clearTimeout(timer); OA. onm ouseover=function () { ADiv [this index]. Style. The display='block'; } OA. onm ouseout=function () { N=this. The index; The timer=setTimeout (function () { ADiv [n]. Style. The display='none'; }, 200); } ADiv [I] onm ouseover=function () { clearTimeout(timer); ='block' this. Style. The display; } ADiv [I] onm ouseout=function () { This. Style. The display='none'; } } } </script> <body>