todd_temple — 2012-06-05T10:03:52-04:00 — #1
ralphm — 2012-06-05T10:11:04-04:00 — #2
One easy way to do it with CSS would be to use a "sprite" background image instead of an image in the HTML. Give a width and height to the <a> and make an image twice the height that contains both image states. On hover, get the background image to move up to reveal the hover state.
todd_temple — 2012-06-05T11:08:05-04:00 — #3
I don't think I have done this correctly. Can you take a peek at the temporary url below?
davemaxwell — 2012-06-05T14:27:14-04:00 — #4
You're getting the image hover, but it's placed wrong. If you look at the bottom left corner, there's a small box which gets created and changed when the larger image is hovered over. What I think you'll want to do is:
- Get rid of the img inside the fancybox link. Place some text there instead.
- Set the width and height of the fancybox class to match the image size you want to use (in your case 400Wx266H).
- Set a large negative margin to hide the text. Or do a search for one of the many image replacement techniques that are out there....
todd_temple — 2012-06-05T15:06:12-04:00 — #5
That does the trick. I guess I was not thinking to remove the image and place the text. for some reason I wanted to leave the photo for the fancy box, not thinking that the class was applied to the anchor and not the text itself. Thanks for both of your tips DaveMaxwell and ralph.m!
darren_p — 2012-12-08T14:59:16-05:00 — #6
I am new to this forum but I am seeking some help with my wedding website. I am a novice in webdesign and am brushing off my dreamweaver skills. I noticed Todd's implementation of the roll over image and then using fancybox to display a gallery. I am trying to do this but rolling over with a white border and then clicking to fancybox's iframe class to display additional information and/or graphics.
So my question is if there's a way using css to put a white border around each icon as i roll over or should i use what i have currently and somehow call the fancybox class somehow?
Thanks for your help ahead of time and excuse me for asking "beginner" questions.
ralphm — 2012-12-08T17:39:59-05:00 — #7
Hi Darren. Welcome to the forums.
I'd say it would be much better to have a single image there and have a white border appear on hover via CSS. Then you can use the image gallery in the normal way.
O, congratulations, but the way.