MyBB Community Forums

Full Version: Greyscale
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Does anyone know if there is an greyscale css filter for Mozilla? I know there is for IE but, I use it for Reset buttons and so on, if they click reset it greyscales all the page and pops up an little message.
Anyways for IE it is.
filter: progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)
Any help would be appreciated. Thanks.
I'm not aware of any CSS filters that work with Fx. Filters is a M$ technology.
I'm aware of that. Still mozilla has "filters", moz-filters. like -moz-opacity
Here's the Mozilla Wiki page:
http://developer.mozilla.org/en/docs/CSS...Extensions

There doesn't seem to be one for modifying rgb values.
Maybe this can help you out:
(works in IE6 and 7 and also in Firefox, supose mozilla will work, Opera dous not...)
<head>
<style type="text/css">

.gradualshine{
filter:alpha(opacity=30);
-moz-opacity:0.3;
}

</style>

<script type="text/javascript">

var baseopacity=30

function slowhigh(which2){
imgobj=which2
browserdetect=which2.filters? "ie" : typeof which2.style.MozOpacity=="string"? "mozilla" : ""
instantset(baseopacity)
highlighting=setInterval("gradualfade(imgobj)",50)
}

function slowlow(which2){
cleartimer()
instantset(baseopacity)
}

function instantset(degree){
if (browserdetect=="mozilla")
imgobj.style.MozOpacity=degree/100
else if (browserdetect=="ie")
imgobj.filters.alpha.opacity=degree
}

function cleartimer(){
if (window.highlighting) clearInterval(highlighting)
}

function gradualfade(cur2){
if (browserdetect=="mozilla" && cur2.style.MozOpacity<1)
cur2.style.MozOpacity=Math.min(parseFloat(cur2.style.MozOpacity)+0.1, 0.99)
else if (browserdetect=="ie" && cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=10
else if (window.highlighting)
clearInterval(highlighting)
}

</script>
</head>
<body>

<img class="gradualshine" src="image.jpg" onmouseover="slowhigh(this)" onmouseout="slowlow(this)" border="0" alt="" width="10" height="10" align="right" />
Just read your post again, you are looking for greyscale, hoewever, maybe it still helps you in someway... good luck! Wink