juven14 / Collapsible

No longer maintaining - Manage multiple collapsibles with cookie support
Other
70 stars 64 forks source link

Close button inside collapsible. #3

Closed kaspar-allenbach closed 12 years ago

kaspar-allenbach commented 12 years ago

Hi.

I'm using your accordeon to expand news entrys.

Now because some expanded entries are very very long, I'd like to have a 'close' button at the inside the accordeon at the end of the content so one can easily close it without scrolling back up to close it.

Is this somehow possible?

juven14 commented 12 years ago

You can add button or link + an click event listener to close it.

I did a quick close link here (view the source to see how its done): http://www.snyderplace.com/demos/collapsible-custom-animation.html

kaspar-allenbach commented 12 years ago

Cool. Thanks :)

Am 29.08.2012 um 17:35 schrieb John Snyder notifications@github.com:

You can add button or link + an click event listener to close it.

I did a quick close link here (view the source to see how its done): http://www.snyderplace.com/demos/collapsible-custom-animation.html

— Reply to this email directly or view it on GitHub.

kaspar-allenbach commented 12 years ago

Hmm. I'm too stupid to implement the jquery listener.

How du I have to Ad it?

Existing Collapsible:

$('.collapsible').collapsible();

So I aded the listener like this:

$('.collapsible').collapsible({ $('.section_close').click(function(event) { event.preventDefault(); parent = $(this).parent().parent().prev('.page_collapsible').collapsible('toggle'); }); });

but that doesn't work.