Results 1 to 2 of 2

Thread: Tab Content script (v 2.0) - Anchor Assistance

  1. #1
    Join Date
    Aug 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tab Content script (v 2.0) - Anchor Assistance

    1) Script Title: Tab Content script (v 2.0)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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



    <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 *}

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:

    Code:
    <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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •