ryeman98 Posted June 2, 2007 Share Posted June 2, 2007 I was wondering if this could even be done in Javascript and I'm not sure how to go about it. I want to display navigation using images (logos) and I want it to work like this: There are multiple logos in a row, all with color. The user hovers their cursor over one of the logos and as soon as they hover, the logo goes colorless. Thanks in advance, Rye Link to comment https://forums.phpfreaks.com/topic/53929-removing-colors-from-image/ Share on other sites More sharing options...
nogray Posted June 4, 2007 Share Posted June 4, 2007 Javascript can't change the images, for this you need to make 2 images for each (colored and gray scale) when the mouse is over the image, swich the source to the grayscale and when the mouse is out use the color version. Also, you can make them as links with a style sheet that change the background colors when the mouse is over the image. Link to comment https://forums.phpfreaks.com/topic/53929-removing-colors-from-image/#findComment-267767 Share on other sites More sharing options...
mainewoods Posted June 7, 2007 Share Posted June 7, 2007 <img src="image.gif" width="88" height="31" style="filter:gray"> http://www.xentrik.net/css/filters.php don't know if it will work, but you can try: <img id="myimage" src="image.gif" width="88" height="31"> <script> document.getElementById('myimage').style.filter = 'gray'; </script> Link to comment https://forums.phpfreaks.com/topic/53929-removing-colors-from-image/#findComment-269628 Share on other sites More sharing options...
mainewoods Posted June 9, 2007 Share Posted June 9, 2007 use this code instead of the code above(added '()' after 'gray'). this works in ie, but not ff <img src="image.gif" width="88" height="31" style="filter:gray()"> http://www.xentrik.net/css/filters.php <img id="myimage" src="image.gif" width="88" height="31"> <script> // turn on document.getElementById('myimage').style.filter = 'gray()'; // turn off document.getElementById('myimage').style.filter = ''; </script> Link to comment https://forums.phpfreaks.com/topic/53929-removing-colors-from-image/#findComment-271238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.