Rails and jQuery: saving states in sessions -
I'm trying to save a jQuery toggle position in a Rail app with little success How do I store? Or will I store it in a cookie? Thanks for your help.
Here the toggle handles jQuery:
$ (function () {function showHideDocuments () {$ ("# accordion"). Toggle ("blind", 500 );}; $ ("#define-document"). Click (function () {showHideDocuments (); return false;});}); I do not really know how to proceed from here thanks!
For anyone else who is struggling with it, here is a solution: jQuery Cookie Plugin Use:
$ (document) .ready (function () {$ ('# finalized-documents') click (function () {if ($ ((': hidden' ) $ (': Hidden')) {$ ('# amperian'). SlideDown (500); $. Cookie ('vismaymount', 'showing');} and if ($ ('$' ('' Slowup (500); $. Cookie ('awkward', 'hidden');}}); ($ cookie ('forgetmeow') == ' Hidden ') {$ (' # accordion '). Hide (); };}); Enjoy.
Comments
Post a Comment