MediaWiki:common.js: Difference between revisions
From WikiROMS
Jump to navigationJump to search
New page: →Any JavaScript here will be loaded for all users on every page load.: <script type="text/javascript"> <!-- var allPageTags = new Array(); function changeColor(class) { var interva... (change visibility) |
No edit summary (change visibility) |
||
Line 12: | Line 12: | ||
var allPageTags=document.getElementsByTagName("*"); | var allPageTags=document.getElementsByTagName("*"); | ||
//Cycle through the tags using a for loop | //Cycle through the tags using a for loop | ||
for (i=0; i<allPageTags.length; i++) { | for (i=0; i<allPageTags.length; i++) { | ||
if (allPageTags[i].className==class) { | if (allPageTags[i].className==class) { |
Revision as of 18:53, 30 October 2007
/* Any JavaScript here will be loaded for all users on every page load. */
<script type="text/javascript">
<!--
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);
}
}
}
//-->
</script>