title : Unobtrusive javascript for applying expand/shrink behaviour
story : This is JS script for applying expand/shrink behaviour
to blocks of html. It works unobtrusivelly, which means
that the HTML document is clean from JS. Everything is
applied dynamicly. Load the script on your head using
<script type='text/javascript' src='collapse.js'></script>
and it will generate buttons and apply behaviour on them.
It will do the job for divs which have a class name
called 'collapsable'. This is customizable of course.
If the client does not have javascript he will see the
whole document expanded on it's original state.
<div class='collapsable'>
<h2>title1</h2>
<p>foo bar example foo bar example foo bar example foo bar example foo bar example foo bar example </p>
</div>
<div class='collapsable'>
<h2>title2</h2>
<p>example.com foo bar example.com foo bar example.com foo bar example.com foo bar </p>
</div>
<div class='collapsable'>
<h2>title3</h2>
<p>example.comfoo barexample.comfoo bar example.com foo bar example.com foo bar example.comfoo barexample.com foo bar example.com foo bar example.com foo bar example.comfoo barexample.comfoo bar example.com foo bar example.com foo bar example.comfoo barexample.com foo bar example.com foo bar example.com foo bar </p>
</div>