MediaWiki:common.js: Difference between revisions
From WikiROMS
Jump to navigationJump to search
No edit summary (change visibility) |
No edit summary (change visibility) |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
alert( | alert("test"); | ||
var allPageTags = new Array(); | var allPageTags = new Array(); |
Revision as of 18:57, 30 October 2007
/* Any JavaScript here will be loaded for all users on every page load. */
alert("test");
var allPageTags = new Array();
function changeColor(class) {
var interval = 1000;
var color1 = "#ff0000"
var color2 = "#000000";
//Populate the array with all the page tags
var allPageTags=document.getElementsByTagName("*");
//Cycle through the tags using a for loop
for (i=0; i<allPageTags.length; i++) {
if (allPageTags[i].className==class) {
allPageTags[i].style.color = (allPageTags[i].style.color == color1) ? color2 : color1;
setTimeout("changeColour('" + class + "')", interval);
}
}
}