Results 1 to 2 of 2

Thread: Tab Content Script (v 2.2) selected tabs not working?

  1. #1
    Join Date
    Sep 2008
    Location
    Southern California
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tab Content Script (v 2.2) selected tabs not working?

    1) Script Title:
    Tab Content Script (v 2.2)

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

    3) Describe problem:
    I have the code that I produced with the basic example and use of some of the other tips on the script page as well as the documentation page, but I can't seem to get the 'selected option' to work.

    I have tried placing the class="selected" portion of code into the link/"a href", the list/"LI", as well as using divs. For some reason, upon page load the first tab (skate in my code) is always selected, and then upon refresh, the last focused tab is the one that is selected.

    Any idea what's wrong? Thanks.
    Code:
    ...
    <h3>Online Dealers</h3>
    <ul id="bannertabs" class="shadetabs">
    <li><a href="#" rel="skate">Skate</a></li>
    <li><a href="#" rel="snow" class="selected">Snow</a></li>
    <li><a href="#" rel="apparel" >Apparel</a></li>
    </ul>
    
    <div style="border:1px solid gray; width:400px; margin-bottom: 1em; padding: 10px">
    	<div id="skate" class="tabcontent">
    	<? echo $skMessage; ?>
    	</div>
    	
    	<div id="snow" class="tabcontent">
    	<? echo $snMessage; ?>
    	</div>
    	
    	<div id="apparel" class="tabcontent">
    	<? echo $apMessage; ?>
    	</div>
    </div>
    
    <script type="text/javascript">
    var banners=new ddtabcontent("bannertabs")
    banners.setpersist(true)
    banners.setselectedClassTarget("link") //"link" or "linkparent"
    banners.init()
    </script>
    ...

  2. #2
    Join Date
    Sep 2008
    Location
    Southern California
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Oh, this was my first post, and I just noticed that there is a "script help" section. Can a moderator/admin move this to the correct board?

    *EDIT*:I found the cause of the problem- the banners.setpersist(true) needs to be made false.
    Last edited by bonesbrigade; 09-05-2008 at 04:16 AM. Reason: Update on problem

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
  •