admijn
04-03-2009, 10:32 AM
1. http://www.dynamicdrive.com/dynamici...edcollapse.htm
2) Script URL (on DD): localhost...
3) Describe problem:
Hi,
I want to use an entire layer as a button. Now I use this code, and it perfectly works fine.
<h1 class="accordion_toggle" onclick="javascript:animatedcollapse.toggle('about')">ABOUT</h1>
<div id="about" class="accordion_content">
content goes here
</div>
But: when I parse the code through a php array like below I, the onclick function isn't working anymore.
$input = array('<div onclick=":animatedcollapse.toggle(\'about\')">ABOUT</div></h3>
<div class="accordion_content2" id=about>
<jdoc:include type="modules" name="work6" style="xhtml" />
</div>'
);
etc. etc. etc.
$rand_keys = array_rand($input, 7);
<h3 class="vertical_accordion_toggle bg_1"><?php echo $input[$rand_keys[0]] . "\n"; ?>
etc. etc. etc.
The code above gives the following output in Firefox.
<h3 class="vertical_accordion_toggle bg_7"><div onclick=":animatedcollapse.toggle('about');">ABOUT</div></h3>
<div class="accordion_content2" id=about>
<div class="moduletable">
While an animated collapse div layer that IS NOT parsed by the php gives this output:
<h1 class="accordion_toggle" onclick="javascript:animatedcollapse.toggle('work')">WORK</h1>
<div id="work">
<div class="accordion_content2">
<div class="moduletable">
What's going wrong here? Pretty looks the same right? The onclick function is working in the 'work' layer, but not in the 'about' layer.
Is this because of the array, or because of the animated collapse is within an animated collapse?
I'm lost atm. :(
Thx in advance!
2) Script URL (on DD): localhost...
3) Describe problem:
Hi,
I want to use an entire layer as a button. Now I use this code, and it perfectly works fine.
<h1 class="accordion_toggle" onclick="javascript:animatedcollapse.toggle('about')">ABOUT</h1>
<div id="about" class="accordion_content">
content goes here
</div>
But: when I parse the code through a php array like below I, the onclick function isn't working anymore.
$input = array('<div onclick=":animatedcollapse.toggle(\'about\')">ABOUT</div></h3>
<div class="accordion_content2" id=about>
<jdoc:include type="modules" name="work6" style="xhtml" />
</div>'
);
etc. etc. etc.
$rand_keys = array_rand($input, 7);
<h3 class="vertical_accordion_toggle bg_1"><?php echo $input[$rand_keys[0]] . "\n"; ?>
etc. etc. etc.
The code above gives the following output in Firefox.
<h3 class="vertical_accordion_toggle bg_7"><div onclick=":animatedcollapse.toggle('about');">ABOUT</div></h3>
<div class="accordion_content2" id=about>
<div class="moduletable">
While an animated collapse div layer that IS NOT parsed by the php gives this output:
<h1 class="accordion_toggle" onclick="javascript:animatedcollapse.toggle('work')">WORK</h1>
<div id="work">
<div class="accordion_content2">
<div class="moduletable">
What's going wrong here? Pretty looks the same right? The onclick function is working in the 'work' layer, but not in the 'about' layer.
Is this because of the array, or because of the animated collapse is within an animated collapse?
I'm lost atm. :(
Thx in advance!