Closed (works as designed)
Project:
Collapse Text
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
8 Mar 2010 at 17:49 UTC
Updated:
25 Jun 2010 at 16:04 UTC
Collapsive text is a great module for text collpasible.
But I saw in Stanford web page that they are using an animated collapse.
Drupal's friends,
How can I use animated collapse in Drupal? Is there any tutorial?
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
Thanks
EPR
| Comment | File | Size | Author |
|---|---|---|---|
| collapse1.jpg | 178.93 KB | elio.pajares | |
| collapse0.jpg | 62.85 KB | elio.pajares |
Comments
Comment #1
joe.bearden commentedAgreed. I'd love to see a way to apply this particular snippet in my Drupal site.
Comment #2
joe.bearden commentedOk, found a way to do it. :)
It's probably not clean at all as I'm not really a programmer, but it works on my site. If someone who actually knows what they're doing would like to help and clean it all up, I think we'd all appreciate it. But here's a start:
Step 1:
To your theme's .info file, add the line:
scripts[] = animatedcollapse.js
Copy the file from the website as listed and copy it into that theme's folder.
Step 2:
To the top of an unfiltered page, add the line:
Copy the file from the website as listed and copy it into your theme's folder.
Step 3:
animatedcollapse.addDiv('jason', 'fade=1,height=80px') animatedcollapse.addDiv('kelly', 'fade=1,height=100px') animatedcollapse.addDiv('michael', 'fade=1,height=120px') animatedcollapse.addDiv('cat', 'fade=0,speed=400,group=pets') animatedcollapse.addDiv('dog', 'fade=0,speed=400,group=pets,persist=1,hide=1') animatedcollapse.addDiv('rabbit', 'fade=0,speed=400,group=pets,hide=1') animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted //$: Access to jQuery //divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID //state: "block" or "none", depending on state } animatedcollapse.init()Paste the remainder of the header into the page:
Step 4:
Paste the example code into the page:
Show Examples 1, 2, 3 | Hide Examples 1, 2, 3
Example 1 (individual):
Note: Fade effect enabled. Height programmically defined. DIV hidden using inline CSS.
Example 2 (individual):
Note: Fade effect enabled. Height programmically defined. DIV hidden using inline CSS.
Example 3 (individual):
Note: Fade effect enabled. Height programmically defined. DIV hidden using inline CSS.
Example 4 (part of group "pets"):
Example 5 (part of group "pets"):
Example 6 (part of group "pets"):
This should work if I didn't miss any steps. It worked for me. Now I'm off to make it work for my site!
Edit: Unfortunately, I can't set this to plain text. Drupal.org is parsing everything. I'm not going to go through and edit everything by replacing codes for symbols to get it to display right. Sorry. :(
Comment #3
pukku commentedThe purpose of this module is to make the drupal provided collapsing behaviour available as an input filter. The animatedcollapse stuff you've linked to requires a third-party javascript library, and is not the same as the drupal collapsing.
I'd rather not complicate the module by adding external dependencies, and having to add configuration screens, etc.
Ricky