View Full Version : Accordion Script - turning off animation?

06-02-2008, 08:32 AM
1) Script Title: Accordion Content script (v1.3)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ddaccordion.htm

3) Describe problem:
Basically the Accordion is animated when clicking to reveal the lists. Right
now I just see the possibility to change the animation speed. Is there also
an option to turn off animation slide at all? I'd rather have just a show and
hide func without any sliding.



06-02-2008, 09:05 AM
The easiest way is just to set the animation duration to a very small number, like 1 milliseconds:

animatespeed: 1, //speed of animation: "fast", "normal", or "slow"

Technically there is still an animation, just so fast it should suffice in fooling people. You can physically edit the .js file to make it truly just show/hide the contents, though it's much less elegant. Let me know if you want to go that route instead.

06-04-2008, 01:32 PM
For the moment I'm fine, thx.

There is just another issue about highlighting the current active menu point.
Basically I get an highlight status for my main menu points. What kind of solution
could be integrated to have the same function for the sub menus point? If someone
is clicking the menu point a new page has been loaded. At the same time this a-tag
should also get an new class for active status.

Right now I was writing a toggle func for this task:

// toggle func for js cat menu
$(".cat ul.level2 a").toggle(
function () {
$(this).css({fontWeight: "bold"}).css({color: "#c64d4d"}).css({backgroundImage: "url(images/icons/nav_item_active.gif)"})
function () {
$(this).css({fontWeight: "normal"}).css({color: "#556469"}).css({backgroundImage: "url(images/icons/nav_item_inactive.gif)"});

But how can I write the status as cookie? It should last as long as no other menu
point under ".cat ul.level2 a" has been clicked?