Home › Forums › Center WordPress Theme › Image Greyscale with CSS & re-color on mouse-over?
- This topic has 7 replies, 2 voices, and was last updated 11 years ago by
findanish.
-
AuthorPosts
-
May 15, 2015 at 1:04 pm #7288
findanish
ParticipantHello,
I would like to make a little change in the portfolio thumbnails. Is it possible to get a Greyscale image to show color on mouseover/hover with the existing magnifying effect?
May 16, 2015 at 1:20 am #7291Hi, there is not the perfect CSS solution for Greyscale filter.
you could refer the css code (It doesn’t work for IE 10/11):
.grayscale { /* Firefox 10+, Firefox on Android */ filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale"); /* IE 6-9 */ filter: gray; /* Chrome 19+, Safari 6+, Safari 6+ iOS, Opera 15+ */ -webkit-filter: grayscale(100%); } .grayscale:hover { filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); -webkit-filter: grayscale(0%); }Best, Bwsm
May 16, 2015 at 5:23 am #7293findanish
ParticipantIts not working. I pasted this code in general settings > Custom Css. I hope thats the correct way.
May 17, 2015 at 4:14 am #7294No, it doesn’t work on your site. It is a reference code only. It needs to be changed base on your html wrap. Paste your page url which you want to use gray effect please.
May 17, 2015 at 11:50 am #7297findanish
Participantdipengada.com/residential
dipengada.com/commercial
dipengada.com/detail
dipengada.com/photographyAll of the above have/will have portfolios. I need thumbnails to use gray effect, not the individual photos inside each portfolios.
May 17, 2015 at 12:44 pm #7298.standard-list-item-img { /* Firefox 10+, Firefox on Android */ filter: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='grayscale'><feColorMatrix type='matrix' values='0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0'/></filter></svg>#grayscale"); /* IE 6-9 */ filter: gray; /* Chrome 19+, Safari 6+, Safari 6+ iOS, Opera 15+ */ -webkit-filter: grayscale(100%); } .standard-list-item-img:hover { filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); -webkit-filter: grayscale(0%); }May 17, 2015 at 12:57 pm #7299findanish
ParticipantIts still not working. Do I have to load all images in color or grayscale for it to work?
May 17, 2015 at 1:02 pm #7300findanish
ParticipantSorry its working, my bad.. Thank you very much again!!
-
AuthorPosts
- You must be logged in to reply to this topic.
