jQuery 側邊菜單

jQuery

側邊

側邊目錄

今天看了  好時價  網站

http://www.houseplus.tw/estimation

發現他們側邊菜單做的不錯

因此研究看看

 

進入主題

我使用了  https://www.berriart.com/sidr/#menu-button

好處是設定簡單,缺點有點單調

 

以下為他的參數

name (String) Default: 'sidr'

Name for the sidr.

speed (Number|String) Default: 200

A string or number determining how long the animation will run.

side (String) Default: 'left'

Left or right, the location for the sidebar.

source (String|Function) Default: null

A jQuery selector, an url or a callback function.

renaming (Boolean) Default: true

When filling the sidr with existing content, choose to rename or not the classes and ids.

body (String) Default: 'body' [ Version 1.1.0 an above ]

For displacing the page the 'body' element is animated by default, you can select another element to animate with this option.

displace (Boolean) Default: true [ Version 1.2.0 an above ]

Displace the body content or not.

timing (String) Default: 'ease' [ Version 2.1.0 an above ]

Timing function for CSS transitions.

method (String) Default: 'toggle' [ Version 2.1.0 an above ]

The action to execute when clicking the button. 'toggle', 'open' and 'close' are allowed.

bind (String) Default: 'touchstart click' [ Version 2.2.0 an above ]

The event(s) to trigger the menu. Only 1 event will be triggered each 100ms, so only the first one will be triggered if there are 2 at the same time.

onOpen (function) Default: function() {} [ Version 1.2.0 an above ]

Callback that will be executed when the menu starts opening.

onOpenEnd (function) Default: function() {} [ Version 2.1.0 an above ]

Callback that will be executed when the menu ends opening.

onClose (function) Default: function() {} [ Version 1.2.0 an above ]

Callback that will be executed when the menu starts closing.

onCloseEnd (function) Default: function() {} [ Version 2.1.0 an above ]

Callback that will be executed when the menu ends closing.

 

少了個設定寬度的...

他說可以進CSS直接改,但我進行了修改沒效果..

 

以上