(c) 2007, DHTML-Menu.com
 
   
   
  Support
  Recent Questions
  Write To Support
 

    Is it possible to change which tab is selected in javascript dynamic menu

Return to Recent Questions


Q: Hi, just a quick question, is it possible to change which tab is displayed when the page is first rendered.

For instance, if you have 4 tabs, going right to left, can you load the javascript dynamic menu with the second tab being displayed first?


A: See, if you use Tab Mode
var tabMode = 1;

var bselectedItem = 0; //main items
var bselectedSmItem = -1; //submenus

If you use
var tabMode = 0;
var bselectedItem = 0;

See, the ID of the item starts with 0.

So, if you use TabMode (var tabMode=1;):

var bselectedItem = 4;

["-", ] - separator, ID = 0
["Mac Tab 1", "content1"], ID = 1
["Subitem1","testlink.html",] ID = 2
["Subitem2","testlink.html",] ID = 3
["Mac Tab 2", "content2"], ID = 4 // selected tab
["Subitem1","testlink.html",] ID = 5
["Subitem2","testlink.html",] ID = 6
["Mac Tab 3", "content3"], ID = 7
["Subitem1","testlink.html",] ID = 8
["Subitem2","testlink.html",] ID = 9
["Mac Tab 4", "content4"], ID = 10
["Subitem1","testlink.html",] ID = 11
["Subitem2","testlink.html",] ID = 12

If you use tabs (var tabMode=0;):

var bselectedItem = 2;

["-", ] - separator, ID = 0
["Mac Tab 1", "content1"], ID = 1
["Mac Tab 2", "content2"], ID = 2 // selected tab
["Mac Tab 3", "content3"], ID = 3
["Mac Tab 4", "content4"], ID = 4





Return to Recent Questions

Related:
   
Copyright (c) 2012, DHTML-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Write Us
All rights reserved. best web design software | website generator | bootstrap navigation menu | bootstrap popup window | jquery slider