-
AuthorPosts
-
March 4, 2016 at 6:52 pm #593457
Hello
My client wants to do something just like this –
example of using 2 images for a portfolio gridObviously the first image is the featured image but could you please tell me how to have each rollover be unique for each entry.
This is the current working page –
So they want to start with a logo and have something like what is there now to appear on hover. Thanks! :)
March 7, 2016 at 5:26 am #594056Hi webWahine,
Maybe this thread could help help you out? http://stackoverflow.com/questions/4717117/css-image-link-change-on-hover
Regards,
RikardMarch 7, 2016 at 6:37 pm #594527That makes sense but how would I implement that into portfolio items, please?
March 12, 2016 at 1:13 pm #597196Hi!
You can try something like this:
.grid-sort-container .grid-entry:hover img { visibility: hidden; } .grid-sort-container .grid-entry:hover article:before { content: ''; display: block; width: 100%; background-size: contain; background-repeat: no-repeat; min-height: 300px; position: absolute; top: 0; left: 0; } .grid-sort-container .grid-entry:hover article:before { background-image: url('http://staging.holborn.ca/wp-content/uploads/projects/littleMountain-logo-495x400.jpg'); }We hid the actual image on hover and then replace it with a pseudo container. We then applied the image as background to this container. This will affect the first portfolio item because we use the nth child selector. http://www.w3schools.com/cssref/sel_nth-child.asp
Example, for the 2nd item:
.grid-sort-container .grid-entry:nth-child(2):hover article:before { background-image: url('http://staging.holborn.ca/wp-content/uploads/projects/ellison-logo-495x400.jpg'); }Cheers!
IsmaelMarch 12, 2016 at 9:05 pm #597262Gotcha! Thanks so much :)
March 12, 2016 at 9:28 pm #597267Hey!
Glad we got it short out.
Please let us know if we can do anything else, to assist you further.Best regards,
Basilis -
AuthorPosts
- You must be logged in to reply to this topic.
