Team:Panama INDICASAT
From 2012.igem.org
(Difference between revisions)
Line 42: | Line 42: | ||
</script> | </script> | ||
- | <script language=" | + | <script language="javascript" type="text/javascript"> |
- | <! | + | <![CDATA[ |
- | function | + | function changeBackgroundColor(objDivID) { |
- | document. | + | var backColor = new String(); |
- | + | ||
- | //- | + | backColor = document.getElementById(objDivID).style.backgroundColor; |
- | </script> | + | |
+ | // IE works with hex code of color e.g.: #eeeeee | ||
+ | // Firefox works with rgb color code e.g.: rgb(238, 238, 238) | ||
+ | // Thats why both types are used in If-condition below | ||
+ | if (backColor.toLowerCase() == '#eeeeee' || backColor.toLowerCase() == 'rgb(238, 238, 238)') { | ||
+ | document.getElementById(objDivID).style.backgroundColor = '#c0c0c0'; | ||
+ | } | ||
+ | else { | ||
+ | document.getElementById(objDivID).style.backgroundColor = '#eeeeee'; | ||
+ | } | ||
+ | } | ||
+ | ]]> | ||
+ | </script> | ||
</head> | </head> |
Revision as of 14:45, 4 September 2012