Results 1 to 2 of 2

Thread: Drop Down Tabs: How to automatically select tab?

  1. #1
    Join Date
    Aug 2007
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Drop Down Tabs: How to automatically select tab?

    1) Script Title:
    Drop Down Tabs
    2) Script URL (on DD):
    http://www.dynamicdrive.com/dynamici...roptabmenu.htm

    3) Describe problem:

    Hi there,

    I've included a version of this wonderful drop down menu to my website but can't get the script to automatically highlight the corresponding tab to the loaded website. The introduction text reads:

    have the script automatically select a tab when the page loads based on a match between the current page's URL and one of the menu tabs'. If there is a match, that tab is selected.
    Since I'm using a php database on my system, I'm not sure how I can get the URL to match the one used in the tab menu.

    The text also referes to some server side scripting to accomplish this automatic-selection thing. Can someone explane to me how this could be done?

    Thanks,
    TOM

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

    Default

    The auto select feature built into the script is very rundamentary, and will only work if the current page's URL matches exactly one of the URLs specified in the main tabs of the script.

    Using server side to do this just means having your dynamic pages return a JavaScript integer variable that corresponds to the tab you wish to have selected for it. In other words, the red portion of the Drop Down Tabs needs to be dynamic when you call it on your page:

    Code:
    tabdropdown.init("bluemenu", 0)
    For example, if your pages are PHP based, the source of your page may look like:

    Code:
    tabdropdown.init("bluemenu", <?echo $currentpageindex;?>)

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
  •