javascript - Build vertical menu with sub-menus -


I am creating my own vertical menu CSS3 & amp; HTML5:
Enter image details here

Let me first "item 1" In two buttons, the first is still "item 1", the second one is the arrow button, which will open / close the hidden edge with the sub-items:

First button - Call default action is selected from sub-templates.

Second Butthouses to choose a user - what to do now or what happens when the 1 button is always pressed.

How can I divide the first item into two buttons?

HTML:

  & lt ;! DOCTYPE html & gt; & Lt; Html & gt; & Lt; Top & gt; & Lt; Script src = "./js/jquery-1.11.1.js" & gt; & Lt; / Script & gt; & Lt; Link href = "./ css / WMenu.css" rel = "stylesheet" /> & Lt; / Head & gt; & Lt; Body & gt; & Lt; Ul class = "WMenu" & gt; & Lt; Li id = "" class = "dublin" & gt; Item 1 & lt; / Li & gt; & Lt; Ul for = "AddPageBtn" class = "WMenuPopup" & gt; & Lt; Li class = "dublub" & gt; Sub-item 1 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 2 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 3 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 4 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Li class = "dublub" & gt; Item 2 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Item 3 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Item 4 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

CSS:

 . Menu {background: URL ("../ images / WMNU / BG page"); Double-repeat: repeat-z; Background-attachment: fixed; List-style-type: none; Font-family: vardana, geneva, non-serif; Font-size: 12px; Height: 100%; Width: 200px; Margins: 0 0 10px; Padding: 0; } / * Выпадающее под-меню * /. Menu popup {list-style-type: none; } .WButton {background: #feffff; Background: -Mo-linear-shield (top, #fIFF 0%, # ddf1f9 35%, # a0d8ef100%); Background: -Widk-Gradient (Linear, Left, Left-Down, Color-stop (0%, #FIFF), Color-stop (35%, # ddf1f9), Color-stop (100%, # a0d8ef)); Background: -webkit-linear-shield (top, #fiff 0%, #ddf 1f 9 35%, # ad8f100%); Background: -o-linear-shield (top, #fiff 0%, # ddf1f9 35%, # a0d8ef 100%); Background: -MMS-linear-shield (top, #fIFF 0%, # ddf1f9 35%, # a0d8ef100%); Background: Linear-gradient (bottom, #phif 0%, # ddf1f9 35%, # a0d8ef 100%); Filters: Przid: Dximage Transforms. Microsoft.gradient (startColorstr = '# feffff', endocrilates = '# A8DF', gradient type = 0); Padding: 4px; Margin-right: 2px; Margin-down: 2px; Width: Auto; Height: auto; } .bouton: hover {cursor: indicator; Background: # 87e0fd; Background: -Mo-linear shield (top, # 87e0fd 0%, # 53cbf1 40%, # 05abe0 100%); Background: -WebKit-Gradient (Linear, Left-hand, Left-Down, Color-stop (0%, # 87e0fd), Color-stop (40%, # 53cbf1), Color-stop (100%, # 05abe0)); Background: -webkit-linear-shield (top, # 87e0fd 0%, # 53cbf1 40%, # 05abe0 100%); Background: -O linear shield (top, # 87e0fd 0%, # 53cbf1 40%, # 05abe0 100%); Background: -MMS-linear-shield (top, # 87e0fd 0%, # 53cbf1 40%, # 05abe0 100%); Background: Linear-gradient (bottom, # 87e0fd 0%, # 53cbf1 40%, # 05abe0 100%); Filters: Preceded by: DXimage TransformsForm Microsoft.gradient (startColorstr = '# 87e0fd', endocrostration = '# 05abe0', gradient type = 0); Padding: 4px; Margin-right: 2px; Margin-down: 2px; font-weight: bold; Width: Auto; }  

Here's a way:

New html:

  & lt; Ul class = "WMenu" & gt; & Lt; Li id = "" class = "split_button button_byte doublet" & gt; Item 1 & lt; / Li & gt; & Lt; Li class = "split_button button_right dublin" & gt; Click! & Lt; / Li & gt; & Lt; Ul for = "AddPageBtn" class = "WMenuPopup" & gt; & Lt; Li class = "dublub" & gt; Sub-item 1 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 2 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 3 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Sub-item 4 & lt; / Li & gt; & Lt; / Ul & gt; & Lt; Li class = "dublub" & gt; Item 2 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Item 3 & lt; / Li & gt; & Lt; Li class = "dublub" & gt; Item 4 & lt; / Li & gt; & Lt; / Ul & gt;  

New CSS:

  .split_button {display: block; Margin-left: 0 pixels; Margin-right: 0 pixels! Important; Box-size: border-box; Swim left; } .split_button.button_left {width: 80%; } .split_button.button_right {width: 20%; Border-left: 1 px solid black; } .WMenuPopup {list-style-type: none; Clear: both; Float: None; }  

will work in all the browsers in the past i8


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -