(c) 2016, Deluxe-Menu.com
Search  
Ctrl+F2 - enter/switch menu | Arrow keys - navigate | Esc - exit menu  
  Support
  FAQ
  Contacts
  About Us
  Recent Questions


 

    I need to load a tab page and have the correct javascript menu rollover tab showing based on a variable...

Return to Recent Questions


Q: I need to load a tab page and have the correct javascript menu rollover tab showing based on a variable that is available when the page loads. How do I get the tab to change to a different tab then the one defined in the configuration file?

Example

bmenuItem = 0; /* this is the default */

When my page reloads I want bmenuItem = someVariable;

How do I do this?

A: Deluxe Tabs doesn't support API functions which can return the selected javascript menu rollover tab.

You can set "bselectedItem" and "var bselectedSmItem" parameters based on your link before you call your data file.

For example, move "var bselectedItem" and "var bselectedSmItem" parameters from your data file to your code.

<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=<?php echo $seltabs; ?>;
var bselectedSmItem=<?php echo $selsmtabs; ?>;
</script>
<SCRIPT src="data.js" type=text/javascript></SCRIPT>
</TD>

You should define seltabs and selsmtabs using server side script.

You can also set it on every page before you call data.js file, for example:

<TD vAlign=top align=left>
/* Select Tab */
<script type="text/javascript" language="JavaScript1.2">
var bselectedItem=4;
var bselectedSmItem=3;
</script>
<SCRIPT src="data.js" type=text/javascript></SCRIPT>
</TD>






Return to Recent Questions

Related:
Bootstrap Toggle Tabs 36 Top Eye-catching and Free AMP Elements Templates for 2021  |  Mobile-friendly Page Maker  |  Fresh CSS Bootstrap Carousel Video Players and Nav Menu Demos  |  15 Recommended Website Makers Arranged by Level Of Popularity  |  30 Killer Free Bootstrap Image Carousel and Gallery Scripts  | 
Copyright (c) 2019, Deluxe-Menu.com
Home  |  Product Info  |  Samples  |  Download  |  Purchase  |  FAQ  |  Site Map  |  Terms of Use  |  Write Us
All rights reserved. Free AI Website Builder | AI Website Builder | AI web design generator | AI website design generator | AI web page design generator