所以,想象一下,我有一個像這樣狹窄的導航菜單:展開導航菜單通過CSS/HTML按鈕,點擊後
窄菜單:
.narrow-menu {
width: 60px;
/* Some more conditions */
}
|[X]| <-- after clicking this button menu should expand as below
| |
| A |
| B |
| C |
| D |
| E |
| F |
| G |
正如你在示例見上面有[X]
按鈕,後點擊它菜單應如下擴展:
完整的菜單:
.full-menu {
width: 300px;
/* Some more conditions */
}
|Profile Photo [X]| <-- after clicking this button menu should became narrow again
|Some Info |
| |
| Home |
| News |
| Contacts |
| About Us |
| |
如您在上面的示例中看到的,再次單擊[X]
按鈕後,應該使菜單再次縮小。
當然這些菜單有不同的HTML div,所以也許實現它我不需要編輯CSS呢?你有想法我怎麼能實現它?
你可以在JS fiddle
顯示您迄今爲止所嘗試的內容 – guradio
您能分享相關的HTML和JQ,以便我們可以幫助您更好嗎? –
@guradio我沒有想法,我怎麼能通過CSS實現它,這就是爲什麼我要求你的幫助,它怎麼可能完成。 – Infinity