PDA

View Full Version : Select Current on DD Tab Menu



blastup
01-10-2008, 12:39 PM
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
<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!

jscheuer1
01-10-2008, 03:12 PM
You are using:


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:


ddtabmenu.definemenu("ddtabs3", 3)

Or try using the URL of the current page in the href attribute of the tab:


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

blastup
01-11-2008, 12:14 AM
hey i actually found a better way
<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

blastup
01-11-2008, 12:18 AM
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