JavaScript Code....

HTML Code....

Simple JavaScript code for Tabing
function showDIV(num){
var cont = document.getElementById('test');
for(i=0;i<=cont.getElementsByTagName('div').length;i++){
if(i==num){
cont.getElementsByTagName('div'[i]).style.display = "";
cont.getElementsByTagName('a')[i].style.textDecoration = "underline";
cont.getElementsByTagName('a')[i].style.backgroundColor = "#EEEEEE";
cont.getElementsByTagName('a')[i].style.border = "1px #AAAAAA solid";
}
else{
cont.getElementsByTagName('div')[i].style.display = "none";
cont.getElementsByTagName('a')[i].style.testDecaration = "none";
cont.getElementsByTagName('a')[i].style.backgroundColor = "#FF0000";
cont.getElementsByTagName('a')[i].style.border = "none";
cont.getElementsByTagName('a')[i].style.fontWeight = "normal";
}
}
}
Simple JavaScript code for Random Image
HTML Code....

JavaScript Code....
function golak(){
var arr = new Array("slide1.jpg", "slide2.jpg","slide3.jpg", "slide4.jpg", "slide5.jpg");
var a = arr.length;
var rnd = Math.floor(a*Math.random());
document.r_img.src = arr[rnd];
}
No comments:
Post a Comment