This javascript will help you for navigating menus. When you click on a specific menu its content gets displayed on the same page without reloading. The tabination links are automatically created for every request. This script is ideal for showing multi-page contents without reloading the rest of the page each time.
Features
a) By using this javascript, we can create navigation menus.
b) Supports the tabination of multiple menus on the same page.
c) Easy to customize.
d) Flexibility in rendering tabination links.
e) Just copy the code and use it into your page.
<!-- Script by hscripts.com -->
<!-- Copyright of HIOXINDIA -->
<!-- More scripts @www.hscripts.com -->
<script type="text/javascript">
var arr=new Array('img1','img2','img3');
var arr1=new Array();
//set the number of menu
var cnt=3;
var tt;
Array.prototype.inArray = function (value)
{
// Returns true if the passed value is found in the
// array. Returns false if it is not.
var i;
for (i=0; i < this.length; i++)
{
if (this[i] == value)
{
return true;
}
}
return false;
};
function Show(Click_Menu)
{
tt=Click_Menu.id;
for(i=1;i<=cnt;i++)
{
var tmp="display"+i;
if(tmp==tt)
{
if(Click_Menu.style.display=="none")
{
Click_Menu.style.display="";
}
}
else
{
document.getElementById(tmp).style.display ="none";
}
}
}
function change_color(iid)
{
arr1.splice(0,arr1.length);
for(var i=0;i<=arr.length;i++)
{
if(arr[i]==iid) {
}
else
{
if(arr.inArray(arr[i]))
arr1.push(arr[i]);
}
}
document.getElementById(iid).style.backgroundColor="#008000";
for(var i=0;i<arr1.length;i++)
{
document.getElementById(arr1[i]).style.backgroundColor="#8AC452";
}
}
function disp()
{
document.getElementById('display1').style.display="";
document.getElementById('display2').style.display="none";
document.getElementById('display3').style.display="none";
}
function ctck()
{
var sds = document.getElementById("dum");
if(sds == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
var sdss = document.getElementById("dumdiv");
if(sdss == null){alert("You are using a free package.\n You are not allowed to remove the tag.\n");}
}
</script>
<!-- Script by hscripts.com -->
For customization of this script or any script development, contact us at support@hscripts.com
Usage
a) This script is used for tabination without refreshing and also for creating navigation menu.
b) Unzip the tabination.zip, extract the tabination.html file to execute.
c) Add any number of menus as you wish.
d) Set the count(cnt) value, which is equal to number of menus added.
e) Right click and save the images.
f) For example, If you add 5 menus then set the count value to 5. Example:
<a href="javascript:Show(display4)">Menu4</a>
In Show() function pass the id of an span tag as an argument.
<span id="display4">
//Give the content
</span>
g) The contents gets changed dynamically according to the navigation menu selection without refresh.
License
- This javascript (misspelled as java script)/HTML code is given under GPL License
- i.e. Free use for those who use it as it is.
- Free, if your modification does not remove our copyright information and links.
- Detailed License information can be found here
- You can purchase the script if your requirements does not meet GPL License terms.