I’ve crackedit to some degree. Been away in Germany last week so slow progress, great country btw
I’ve been trying to figure out how to start it as open but cant do so far. My HTML inside the accordion (Which is taken from an external source (legally)) shows when closed. I cant seem to see why this is
My code is below:
I’m still playing and loving the leanring curve, I cant explain how much I’ve lerant just by tryng to figure out my own mistakes but sometimes I seem to exhaust all problems!!! It’ll come though
I was in Hamburg on business. Nice city, really liked the German culture. Could definitely live there as its similar to the UK but a little bit nicer
I really appreciate your help. I’ve learnt loads form what you have come back to me with so I thank you very much
I still can’t work out why the code inside the accordion shows on each tab when closed (As shown in my fiddle posted previously). I’ve tried changing the display to BLOCK etc but I’ve come to the conclusion that it’s the code inside rather than the accordion code?
I’ve come to this conclusion as when I put a simple paragraph in there this doesn’t happen, it only happens when the inner code is in there. Unfortunately as it’s a feed I don’t know where to go now. I spent 8 hours yesterday trying to work this out (I secretly enjoyed it). I’m sure there will be a simple fix but not sure where!!!
Yeah, Hamburg is nice. It is quite famous for its musicals and for its fish market, which is worth a visit at 5am after a hard night on the Reeperbahn :).
This is why I like JS. It gives you much more control over how things are displayed after the DOM has loaded.
Hi again, sorry to bring this back up but I’m playing with two accordions (one vertical/ one horizontal) now but want both to start open
I have tried playing with the trigger in javascript but to no avail. Logic told me if I called on of my triggers trigger 1 then it would read separate but that wasn’t the case!
Before we get on to the JS I have a question:
You have your CSS set up so that every time you click an accordion panel it will close all other open accordion panels on the page before opening itself.
This means you cannot have different panels open in different accordions at the same time.
Is this the desired behaviour?
Is it possible that you ammend the CSS first, then?
If you are not sure how to do this, could you post a link to the site where you found the accordion code?
So, I’ve been looking at this for a good while now and I’m afraid it doesn’t seem to be possible to have two accordions of this nature operating independently of each other on the same page.
This is borne out by the fact that the same behaviour can be seen on the author’s demo page: http://media02.hongkiat.com/css-based-accordion/demo/index.html
(Try opening a tab in one accordion, then clicking on a tab in the other - you will see the first tab close).
So, at this juncture, the best advice I can give you is to look for another accordion script which will cater for the desired behaviour (more than one accordion on the page at once).
Do your accordions have to be horizontal and vertical, or will just horizontal do?
Or, if you are set on this accordion, maybe you could ask for help in the CSS forum, as to whether anyone there knows how to have two accordions operating on one page.
The interface itself is easy to use and has a bunch of useful options, the resultant accordion is highly configurable and degrades nicely when JS is turned off.
You can also have more than one accordion per page and can change the style from vertical to horizontal by just passing in a parameter.