开发者

Prototype plugin need for expanding and hiding divs and remembering state of choices for user

While viewing or editing in a rather complicated form, I'd love to be able to have the user close and open "sections" of the page depending on what they are using it for.

The trick is that I'd also like to keep track of those choices as preferences, so that the next time you look at a record of the same sort, you will see the same sections.

What I am envisioning is something like:

<div class='expandable'>
  <h2>Some heading</h2>
  <div id='some-stuff-you-might-not-want-to-see' class='expandable-body'>
      ...
  </div>
 </div>

When the page is loaded, you'd see the section, but if you clicked on a toggle button on the div, you'd hide it, and if you go to another record of the same type, th开发者_JAVA百科e section remains hidden.

I don't really want to roll my own, and I'm okay if it is entirely client-side, using cookies to determine which sections to hide. Anybody know of something like this?

Rails 2.3.5, Ruby 1.8.7, using Prototype.


I think you answered this yourself. Use a cookie to remember the choice, then use prototype to hide the div(s). I don't think you'll find a full fledged plug-in to do this for you.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜