When I click on the javascript menu tab always only one tab is selected.
Return to Recent Questions
Q:
The problem that I am still experiencing (Im sure I have missed something
obvious!) - is that all the pages open when you click on the relevant links
but they always open with the "About Us" tab showing and then as soon as you
click on a different tab you see it highlight for a second and then it just
reverts back to the About Us tab even though the page has changed. As the
site opens I obviously want the first tab to be highlighted as opposed to
the 2nd one and the each page highlights and holds as you go through the
menu.
A:
See, you set
var bselectedItem=2;
That is why "About us" tab is selected.
You should change the selected tab depending on the page you are now.
This Tabs menu can save pressed item automatically within
1 page only. If you open another page, the menu can't remember pressed
item. You should do that manually using Javascript and menu parameters
(var bselectedItem) or using any server-side script (php, asp, etc.)
Deluxe Tabs doesn't support API functions which can return the
selected tab.
If your site is written on PHP you can set "bselectedItem" parameter based on your link before
you call tabs-kasper.js file.
For example, move "bselectedItem" parameter from tabs-kasper.js file to your
code.
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=<?php echo $seltabs; ?>;
</script>
<SCRIPT src="tabs-kasper.js" type=text/javascript></SCRIPT>
</TD>
You should define seltabs using server side script.
You can also set on every page before you call tabs-kasper.js file
(for example, for solution tab).
<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=4;
</script>
<SCRIPT src="tabs-kasper.js" type=text/javascript></SCRIPT>
</TD>
Try that.
Return to Recent Questions
|