This script will rotate thru a series of bg colors upon rollover.
What I hope to do is call up more than one set of colors, that is, separate color palettes... Either by use of a different id or calling a function with a different name.
Any help would be hugely appreciated.
PS. please replace (DOT) with a "." in three places at the end of the script...sorry, couldn't figure out the proper tag
<html><head><title></title>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<script language=javascript>
colors = ["#cacdca", "#b2b4b2", "#969896", "#7d7f7d", "#ffff00"];
cRGB = [];
function toRGB(color){
var rgb = "rgb(" + parseInt(color.substring(1,3), 16) + ", " + parseInt(color.substring(3,5), 16) + ", " + parseInt(color.substring(5,7), 16) + ")";
return rgb;
}
for(var i=0; i<colors.length; i++){
cRGB[i] = toRGB(colors[i]);
}
function changeColor(target){
var swapper = navigator.appVersion.indexOf("MSIE")!=-1 ? toRGB(document.getElementById(target).style.backgroundColor) : document.getElementById(target).style.backgroundColor;
var set = false;
var xx;
for(var i=0; i<cRGB.length; i++){
if(swapper == cRGB[i]){
if(((i+1)) >= cRGB.length){
xx = 0;
}else{
xx = i+1;
}
document.getElementById(target).style.backgroundColor = colors[xx];
document.getElementById(target).style.backgroundImage.show;
set = true;
i=cRGB.length;
}
}
set ? null : document.getElementById(target).style.backgroundColor = colors[1];
}
</SCRIPT>
<meta content="MSHTML 6.00.6000.16809" name=GENERATOR></head>
<body bgcolor="333333">
<div>
<div id=a1 onmouseover=changeColor(thisDOTid);
style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: none"></div>
<div id=a2 onmouseover=changeColor(thisDOTid);
style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: #666633"></div>
<div id=a3 onmouseover=changeColor(thisDOTid);
style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: #666633"></div></div>
</body>
</html>
- <html><head><title></title>
- <meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
- <script language=javascript>
- colors = ["#cacdca", "#b2b4b2", "#969896", "#7d7f7d", "#ffff00"];
- cRGB = [];
- function toRGB(color){
-
- var rgb = "rgb(" + parseInt(color.substring(1,3), 16) + ", " + parseInt(color.substring(3,5), 16) + ", " + parseInt(color.substring(5,7), 16) + ")";
-
- return rgb;
- }
- for(var i=0; i<colors.length; i++){
-
- cRGB[i] = toRGB(colors[i]);
- }
- function changeColor(target){
-
- var swapper = navigator.appVersion.indexOf("MSIE")!=-1 ? toRGB(document.getElementById(target).style.backgroundColor) : document.getElementById(target).style.backgroundColor;
-
- var set = false;
-
- var xx;
-
- for(var i=0; i<cRGB.length; i++){
-
- if(swapper == cRGB[i]){
-
- if(((i+1)) >= cRGB.length){
-
- xx = 0;
-
- }else{
-
- xx = i+1;
-
- }
-
- document.getElementById(target).style.backgroundColor = colors[xx];
- document.getElementById(target).style.backgroundImage.show;
-
- set = true;
-
- i=cRGB.length;
-
- }
-
- }
-
- set ? null : document.getElementById(target).style.backgroundColor = colors[1];
- }
- </SCRIPT>
- <meta content="MSHTML 6.00.6000.16809" name=GENERATOR></head>
- <body bgcolor="333333">
- <div>
- <div id=a1 onmouseover=changeColor(thisDOTid);
- style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: none"></div>
- <div id=a2 onmouseover=changeColor(thisDOTid);
- style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: #666633"></div>
- <div id=a3 onmouseover=changeColor(thisDOTid);
- style="left: 120px; width: 180px; background-repeat: no-repeat; position: relative; height: 80px; background-color: #666633"></div></div>
- </body>
- </html>