How is the menu for the Vaadin 7 sampler done? -
The Sampler demo for Wadia 7 is powered by a menu that the user clicks on a hamburger button.
Although there are some source code for examples of sample demo, but it does not provide the source of the demo itself. I am trying to figure out how to recreate that menu. Any ideas?
I think this can only be done using CSS and can change some class attributes on the button click. Here's a very simple example:
& lt; Html & gt; & Lt; Top & gt; & Lt; Style Type = Text / CSS & gt; Box {status: absolute; Width: 400px; Height: 60%; Background color: green; Correct: -200px; -M-Infection: All 1s ease; Webkit-Infection: All 1s ease; Transition: All 1s ease; } .box_t {top: 0} .box_b {top: 40%}. Box2_t {-ms-transform: rotateY (-90deg) skewY (-20deg); -WebKit-transform: rotate (-90 degrees) skewY (-20 degrees); Convulsively rotate (-90 degrees) skewY (-20deg); } .box2_b {-ms-transform: rotateY (-90deg) skewY (20deg); Webkit-Conversion: Rotate (-90 degrees) skewY (20deg); Convulsually rotate (-90 degrees) Schu (20 degrees); } & Lt; / Style & gt; & Lt; Script type = text / javascript & gt; Function changeclass () {document.getElementById ("ka_t"). ClassName = "box box_box box2_t"; Document.getElementById ("ka_b"). ClassName = "box box_b box 2_b"; } Window.onload = function () {document.getElementById ("button"). AddEventListener ('click', changeclass); } & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body style = "height: 100%" & gt; & Lt; Button ID = Button & gt; Close & lt; / Button & gt; & Lt; Div id = ka_t class = "box box_t" & gt; & Lt; / Div & gt; & Lt; Div id = ka_b class = "box box_b" & gt; & Lt; / Div & gt; & Lt; / Body & gt; & Lt; / Html & gt;
Comments
Post a Comment