PDA

View Full Version : Tab Content script (v 2.0) - Anchor Assistance



dalmuti
08-01-2008, 03:56 PM
1) Script Title: Tab Content script (v 2.0)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

3) Describe problem: I would like to add an anchor tag to the code so it will change to the tab and also jump to that tab...since the tabs are lower on the page and the user cannot tell that anything has happened.

You can see example on this page:
link to site (http://www.costumecauldron.com/shop/costume/buzz-lightyear-dlx-sz-3t-4t.html)



<a href="javascript:maintab.expandit(1)">Tell a friend about this product</a>


{* TABS MENU START *}

<a name="tabs" id="tabs"></a>
<div id="sbtabsmenu">
<ul id="maintab">

{if $active_modules.Upselling_Products ne ""}
<li><a href="#tabs" rel="tcontent1" class="selected"><span>{$lng.lbl_upselling_links}</span></a></li>
{/if}

{if $config.Appearance.send_to_friend_enabled eq 'Y'}
<li><a href="#tabs" rel="tcontent2" id="friend"><span>{$lng.lbl_send_to_friend}</span></a></li>
{/if}

{if $active_modules.Customer_Reviews ne ""}
<li><a href="#tabs" rel="tcontent3" name="reviews"><span>{$lng.lbl_customer_reviews}</span></a></li>
{/if}

</ul>
</div>

<div class="tabcontentstyle">

{if $active_modules.Upselling_Products ne ""}
<div id="tcontent1" class="tabcontent">
{*{include file="modules/Upselling_Products/related_products.tpl" }*}
{include file="customer/main/products_t.tpl" products=$product_links}
</div>
{/if}

{if $config.Appearance.send_to_friend_enabled eq 'Y'}
<div id="tcontent2" class="tabcontent">
{include file="customer/main/send_to_friend.tpl" }
</div>
{/if}

{if $active_modules.Customer_Reviews ne ""}
<div id="tcontent3" class="tabcontent">
{include file="modules/Customer_Reviews/vote_reviews.tpl" }
</div>
{/if}

</div>


<script type="text/javascript">

var maintab=new ddtabcontent("maintab") //enter ID of Tab Container
maintab.setpersist(false) //toogle persistence of the tabs' state
maintab.setselectedClassTarget("linkparent") //"link" or "linkparent"
maintab.init()

</script>

{* TABS MENU END *}

ddadmin
08-01-2008, 07:13 PM
Why not just create an HTML anchor right above the Tabs, then inside your link at the top, link to this HTML anchor. Something like:


<a href="#tabsanchor" onClick="maintab.expandit(1)">Tell a friend about this product</a>

BTW, please note that your page is currently in violation of our usage terms, since the credit notice doesn't appear inline on the page. Please reinstate the credit notice: http://www.dynamicdrive.com/notice.htm