Im working out a jquery based accordion menu. Here’s the thing:
I tried an ‘if statement’ too without success. I guess it won´t be such a difficult thing to get!! Any tip?
Yeap, I kind of understand second chunk of code a little better. I definitely need to get used to store things in variables. It really clears things up.
My first thinking was detecting whether the toggled element is visible or not. I guess I didn´t make it to work out and keep ‘dinamicity’ at the same time.
I never saw this syntax before:
? downArrow : upArrow;
I take it swapping arrows is what that bit really does. There’s one weird thing happening though. After toggling ‘target’, that is, after clicking on any .topic and showing and hiding .2ndul underneath this .topic, some of the arrow symbols in other .topic disappear. All of them but the last one. At the end there’s only one arrow symbol left …
Ahh, good catch. What’s happening is that replaceWith is not adding a copy of the indicator, but is instead moving a reference to indicator from one place to another. We can fix that issue by replacing the arrow with a copy (a clone) of the indicator instead.
This script has a problem in ie browsers on page load all the listing display on the screen by default and accordion/toggling doesn’t effect them. is there any possible way to work this script in IE browsers as well.