¡@

Home 

2014/10/16 ¤W¤È 12:09:31

jquery Programming Glossary: togglepanel

jquery fade slide panel

http://stackoverflow.com/questions/10061847/jquery-fade-slide-panel

.ready function var panels '.panels .panel' '#menu li' .on 'click' 'a' function panels.filter '.' this.id .trigger 'togglePanel' panels .on 'togglePanel' function var this this activePanels panels.filter ' visible' .not this if activePanels.length.. '.panels .panel' '#menu li' .on 'click' 'a' function panels.filter '.' this.id .trigger 'togglePanel' panels .on 'togglePanel' function var this this activePanels panels.filter ' visible' .not this if activePanels.length activePanels .one 'panelHidden'.. this.trigger 'panelShown' panels.find '.content .close' .on 'click' function this .closest '.panel' .trigger 'togglePanel' I have used the pub sub pattern which makes things easier. We minimize the redundant code. And the work flow is easier..

jQuery Toggle Cookie Support

http://stackoverflow.com/questions/1982233/jquery-toggle-cookie-support

.ready function var button '#hideButton' check the cookie when the page loads if .cookie 'currentToggle' 'hidden' togglePanel button false else togglePanel button true handle the clicking of the show hide toggle button button.click function toggle.. '#hideButton' check the cookie when the page loads if .cookie 'currentToggle' 'hidden' togglePanel button false else togglePanel button true handle the clicking of the show hide toggle button button.click function toggle the panel as required base.. show hide toggle button button.click function toggle the panel as required base on current state if button.text Show togglePanel this true else togglePanel this false function togglePanel button show var panel '#panel' if show panel.removeClass 'hidden'..