View Full Version : Miscellaneous Hacks - Turn colors on/off
Mazinger
11-19-2007, 10:00 PM
This modification allows users to turn on/off colors in the style (grayscale) - (works in IE Only).
Screenshot:
http://img119.imageshack.us/img119/2807/examplest9.gif
--------
Installation:
In Navbar, search for:
</tr>
</table>
<!-- / breadcrumb, login, pm info -->
Above it, add:
<!-- colors form -->
<td class="alt1">
<script language="JavaScript">
<!--
function ColorsOff()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=1)";
}
function ColorsOn()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=0)";
}
function changeButton()
{
if (document.onoff.B1.value=='Colors Off')
{
document.onoff.B1.value='Colors On';
ColorsOff()
}
else
{
document.onoff.B1.value='Colors Off';
ColorsOn()
}
}
//-->
</script>
<form name="onoff">
<input type="button" value="Colors Off" name="B1" class="button" style="width: 80px;" onClick="changeButton()" />
</form>
</td>
<!-- / colors form -->
Save the work.
--------
Credits: Thanks to Wayne Luke for his help in making this mod.
What's next: Looking for someway to save selected option with cookies.
daz1967
11-20-2007, 06:54 PM
Interesting thanks
testebr
11-20-2007, 07:37 PM
Work only in IE and it's very useless.
TigerWare
11-20-2007, 07:56 PM
Work only in IE and it's very useless.
Think "People With Visual Impairments". It may actually be quite useful to the "usually forgotten minority". To be visually impaired is a huge problem for some surfers as they have great difficulty with certain colours. Having a button to swith off colours can be a huge asset on a specialist website. Not 'useless' at all.
Good job Mazinger!
lostgirl815
11-20-2007, 08:06 PM
Oh, very nice! Tagging this for future use.
Mazinger
11-20-2007, 08:07 PM
Think "People With Visual Impairments". It may actually be quite useful to the "usually forgotten minority". To be visually impaired is a huge problem for some surfers as they have great difficulty with certain colours. Having a button to swith off colours can be a huge asset on a specialist website. Not 'useless' at all.
Good job Mazinger!
Exactly! Thanks for the info. :)
Fungsten
11-20-2007, 08:16 PM
It didn't work on my test board. BTW, the button appeared below the Navbar. 3.6.8 PL1. TIA.
Mazinger
11-20-2007, 08:19 PM
I tested it on IE - not sure about FF, probably I can test it on FF this week.
@Fungsten, add the code above this:
<!-- / breadcrumb, login, pm info -->
Fungsten
11-20-2007, 08:21 PM
I tested it on IE - not sure about FF, probably I can test it on FF this week.
@Fungsten, add the code above this:
<!-- / breadcrumb, login, pm info -->
Here's where I put it:
</tr>
</table>
<!-- colors form -->
<td class="alt1">
<script language="JavaScript">
<!--
function ColorsOff()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=1)";
}
function ColorsOn()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=0)";
}
function changeButton()
{
if (document.onoff.B1.value=='Colors Off')
{
document.onoff.B1.value='Colors On';
ColorsOff()
}
else
{
document.onoff.B1.value='Colors Off';
ColorsOn()
}
}
//-->
</script>
<form name="onoff">
<input type="button" value="Colors Off" name="B1" class="button" style="width: 80px;" onClick="changeButton()" />
</form>
</td>
</tr>
</table>
<!-- / colors form -->
<!-- / breadcrumb, login, pm info -->
Mazinger
11-20-2007, 09:24 PM
Add the code above the first two lines:
</tr>
</table>
Fungsten
11-20-2007, 09:27 PM
Add the code above the first two lines:
</tr>
</table>
Thanks. But the color off still doesn't work. TIA.
Mazinger
11-20-2007, 09:29 PM
Are you using FF or IE?
I'll try do some tests of FF this week.
Fungsten
11-20-2007, 09:30 PM
Are you using FF or IE?
I'll try do some tests of FF this week.
IE7.
Mazinger
11-20-2007, 09:53 PM
I haven't checked on IE7 yet, though I think it should work on it.
btw, make sure you've this line at the top of your pages' source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Fungsten
11-21-2007, 01:24 AM
I haven't checked on IE7 yet, though I think it should work on it.
btw, make sure you've this line at the top of your pages' source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Is that at the top of the Navbar Template? It's not there.
Triky
11-21-2007, 06:55 AM
Nice idea!
Mazinger
11-21-2007, 07:07 AM
No, not in a template.
Open any of your pages source (right click and View Source), it should be in the first line.
Mazinger
11-21-2007, 07:31 AM
It's not working on FF, the same way grayscale doesn't work when you try to logout.
Anyone here to confirm it's working on IE7?
Fungsten
11-21-2007, 03:02 PM
No, not in a template.
Open any of your pages source (right click and View Source), it should be in the first line.
Here's what I have:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html dir="ltr" lang="en">
<head>
Almotmaiz.Net
11-21-2007, 08:49 PM
nice !!
*Installed*
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.