Results 1 to 4 of 4

Thread: Select Current on DD Tab Menu

  1. #1
    Join Date
    Oct 2006
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Exclamation Select Current on DD Tab Menu

    1) Script Title:
    DD tab Menu
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamicindex1/ddtabmenu.htm
    3) Describe problem:
    Ok the script select the current item by javascript..i am trying to make the script using if condition to dynamicly style the code to its current url..becuase the javascript is not really reliable for selecting tabs.. how do you use current tabs? when i tried that.. it did not work!i did this
    HTML Code:
    <li><a href="#nogo" rel="menu4" class="current">Directory</a></li>
    but the problem is the stuff on the bottom sub tabs dont come up.. can you help me with that thanks!
    i own a webmasters forum.. on http://millionwebmasters.com please check it out! the error is on live right now!

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    You are using:

    Code:
    ddtabmenu.definemenu("ddtabs3", "auto")
    To initialize, but have no URL that matches the current page.

    The second parameter lets you set which tab should be selected by default- enter either an integer (0=1st tab, 1=2nd tab etc), or "auto" to have the script try to automatically select the tab that matches the current page's URL.
    You could use:

    Code:
    ddtabmenu.definemenu("ddtabs3", 3)
    Or try using the URL of the current page in the href attribute of the tab:

    Code:
    <a href="http://millionwebmasters.com/" rel="menu4" class="current">Directory</a>
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Oct 2006
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    hey i actually found a better way
    Code:
    <if condition="in_array($foruminfo['forumid'], array(8, 62, 66, 67, 68, 10))">
    <script type="text/javascript">
    ddtabmenu.definemenu("ddtabs3",0)
    </script>
    <else />
    <if condition="in_array($foruminfo['forumid'], array(1, 2, 151, 55, 56, 57, 58, 59, 60, 64, 65, 61))">
    <script type="text/javascript">
    ddtabmenu.definemenu("ddtabs3",1)
    </script>
    </if>
    </if>
    since its the javascript that controls it i if conditioned it! because if you do current on the links! it does not really work.. thanks alot for your help anyways

  4. #4
    Join Date
    Oct 2006
    Posts
    22
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    but i guess the bad thing about it is you have to wait until the whole page loads.. for the menu to show.. but its is still sweet

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
  •