Results 1 to 5 of 5

Thread: How to Select Tabs Dynamically with DD Menu II

  1. #1
    Join Date
    Nov 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to Select Tabs Dynamically with DD Menu II

    HI, I urgently need a way of accomplishing the following with DD Menu II:

    1) I need to be able to set the selected tab based on the page that is opened which I get using the $_GET['loadpage'] parameter. There are times when I do not want any tab "selected" but the contents menu populated.

    2) I need to be able to make the previous tab selected on mouseout of the entire tab area, meaning that mouseout is not kicked in unless the mouse hovers out of both the tabs and the contents menu.

    3) Need to have the contents menu populated by default based on the page opened (I have text variables defined for each page), and when the mouseout event is kicked in as part of 2 above, the default menu text is repopulated in the contents area.

    Help would be deeply appreciated.
    Last edited by ddadmin; 11-16-2009 at 07:21 AM.

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

    Default

    What does $_GET['loadpage'] return as far as the possible values? If it's a number that corresponds to the tab number you wish to be selected (ie 1=1st tab), then you'd simply use PHP to dynamically generate this line within the script:

    Code:
    var initialtab=[1, "sc1"]
    Changing 1 and "sc1" to the tab and tab content ID you want selected, respectively. To output JavaScript dynamically using PHP, you'd write out the surrounding <script> tags, plus the body of the JavaScript that should be dynamic. In this case, something like:

    Code:
    echo '<script type="text/javascript">\n';
    echo 'var initialtab=[' . $_GET['loadpage'] . ',sc"' . $_GET['loadpage'] . '"]\n';
    echo '<\/script>';
    The above should proceed the reminder of the Tab Content script, which is just static. Also, be sure to delete the original line:

    Code:
    var initialtab=[1, "sc1"]
    inside the script, so it doesn't override the dynamically generated one above.

    For 2), doesn't the menu already behave this way? In the default demo for example, if you move your mouse over the "CSS" tabs, it stays there and doesn't snap back to the currently selected tab onmouseout of the menu.
    DD Admin

  3. #3
    Join Date
    Nov 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    $_GET('loadpage') returns the URL of the page that is being loaded. In turn, I use code to extract the name of the page itself, i.e., login.

    What I am struck on, is I need the tabs to return to the original page as soon as the mouse is moved out of the entire tab wrapper, which includes the contents area below.

    From my original post...only item 2 needs addressed at this point. I figured out 1 and 3 on my own. The mouseout feature is spotty as it's not working when I mouse out of the tabs wrapper div that I created.

  4. #4
    Join Date
    Nov 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    No answer???? I hate to drop this script after this long. There has to be a way.

  5. #5
    Join Date
    Nov 2009
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You know, I really like this script and this website, but too much of the script is too generic and difficult to customize. Would be nice if there was better support available to answer questions or at least point us in the right direction, even if we had to pay a little for the script instead of free. I can't see how this website can be making money on ads if people get disgusted with the script because it dont perform exactly as described.

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
  •