noobie123
09-24-2010, 12:19 AM
1) Script Title: Horizontal Accordion script
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/haccordion.htm
3) Describe problem: I've been trying to use the script on a website that displays different images depending on what somebody clicks on. I've used display: none; to hid what isn't currently being shown, but this seems to stop the accordion script for working. Is it possible to have these both working together? I've copied the code from here exactly the only thing I've changed is I've added the display style to the <DIV> containing each haccordion, for example:
<div class="scroller1" id="1000" style="display: block;">
<a href="javascript:thumbnailslast()"><img src="images/portfolio_left.png" alt="" style="float: left; margin: 35px 55px 0 50px;"/></a>
<div id="hc1" class="haccordion">
<ul>
<li>
<a href="javascript:one()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/one.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:two()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/two.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:three()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/three.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:four()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/four.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
</ul>
</div>
<a href="javascript:thumbnailstwo()"><img src="images/portfolio_right.png" alt="" style="float: right; margin: 35px 45px 0 0;"/></a></div>
<div class=" scroller2" id="2000" style="display: none;">
<a href="javascript:thumbnailsfirst()"><img src="images/portfolio_left.png" alt="" style="float: left; margin: 35px 55px 0 50px;"/></a>
<div id="hc2" class="haccordion">
<ul>
<li>
<a href="javascript:one()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/five.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:two()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/six.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:three()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/seven.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:four()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/eight.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
</ul>
</div>
<a href="javascript:thumbnailsthree()"><img src="images/portfolio_right.png" alt="" style="float: right; margin: 35px 45px 0 0;"/></a></div>
I'd appreciate any help with this.
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/haccordion.htm
3) Describe problem: I've been trying to use the script on a website that displays different images depending on what somebody clicks on. I've used display: none; to hid what isn't currently being shown, but this seems to stop the accordion script for working. Is it possible to have these both working together? I've copied the code from here exactly the only thing I've changed is I've added the display style to the <DIV> containing each haccordion, for example:
<div class="scroller1" id="1000" style="display: block;">
<a href="javascript:thumbnailslast()"><img src="images/portfolio_left.png" alt="" style="float: left; margin: 35px 55px 0 50px;"/></a>
<div id="hc1" class="haccordion">
<ul>
<li>
<a href="javascript:one()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/one.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:two()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/two.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:three()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/three.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:four()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/four.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
</ul>
</div>
<a href="javascript:thumbnailstwo()"><img src="images/portfolio_right.png" alt="" style="float: right; margin: 35px 45px 0 0;"/></a></div>
<div class=" scroller2" id="2000" style="display: none;">
<a href="javascript:thumbnailsfirst()"><img src="images/portfolio_left.png" alt="" style="float: left; margin: 35px 55px 0 50px;"/></a>
<div id="hc2" class="haccordion">
<ul>
<li>
<a href="javascript:one()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/five.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:two()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/six.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:three()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/seven.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
<li>
<a href="javascript:four()"><div class="hpanel">
<img src="images/portfolio_images/thumbnails/eight.png" style="float:left; padding-right:8px;" /><p>The Andaman Sea is regarded as Thailand's most precious natural resource as it hosts the most popular and luxurious resorts in Asia.</p>
</div></a>
</li>
</ul>
</div>
<a href="javascript:thumbnailsthree()"><img src="images/portfolio_right.png" alt="" style="float: right; margin: 35px 45px 0 0;"/></a></div>
I'd appreciate any help with this.