Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
javascript toggle
I have a list of authors styled by a form.
I want the author, when clicked to toggle open some info about them, not unlike the “advanced options” does in the write tab.
I know I would use something like this:
<code>
<p><a href=”#” onclick=“toggleDisplay(xxxxxxxxx);return false;”>xxxxxxxxxx</a></p>
</code>
The information I want to toggle is in three tags:
one produces unformated text
one produces textiled text which is wrapped in < p > tags
one is an image
(and I may need some styling divs in there)
1. So, what would the javascript (in the head) look like?
2. What goes where the “xxxxxxx”‘s are?
Help please?
Thanks,
Matthew
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#2 2005-11-15 14:09:48
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: javascript toggle
Hi Matthew, I found how to do that here.
Offline
Re: javascript toggle
Hi Doggiez,
As ever, Thank you. I guess I should have googled longer. I had found a bunch of non-example oriented instructions. I don’t learn very well without seeing – ya know.
Thanks.
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Re: javascript toggle
I have noticed, that the link above gives an example that uses div ID’s and therefore won’t validate on a list where div classes are necessary.
In addition, I can’t figure out how I would go about getting the javascript to work with a dynamically created list?
Any additional thoughts?
Thanks,
Matthew
I would love to replicate this but valid.
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#5 2005-11-16 15:55:05
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: javascript toggle
It looks like the div id is also dynamically created, so that it is not repeated more than once.
You’ll need a coder to help you with this I’m afraid…
Offline
Re: javascript toggle
Doggiez,
Do you know one I could ask?
I mentioned it to Mary, but she’s a busy person.
Matthew
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
#7 2005-11-16 17:35:37
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: javascript toggle
Sorry Matthew, I honestly wouldn’t know :(
Look for plugins that also use javascript and ask the writer? Or just hope that someone visits this thread and recognises a challenge ;)
Offline
Re: javascript toggle
Seems like you could do this fairly simply with PHP.. something like a plugin that generated lists with # ids that increased by one each time. then use javascript to hide/show(this) for each <code><li></code>. I have made a plugin that does something similar with multiple article images. Not sure how to access the author list that you are trying to output though…
Last edited by Jeff_K (2005-11-17 08:26:00)
Offline
Re: javascript toggle
matthew, this should work for you, it uses classes to define the toggles:
<a href=“http://www.onlinetools.org/tools/domcollapse/”>domcollapse</a>
~~~~~~~~~~~~~| monolinea.com | pixilate.com | istockphoto.com/kemie |~~~~~~~~~~~~~
Offline
Re: javascript toggle
Kemie,
Great, thank you.
I will check that out.
Matthew
- I am Squared Eye and I
am launchinghave launched Pattern Tap
Offline
Pages: 1