- This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
Viewing 9 posts - 1 through 9 (of 9 total)
- The forum ‘CSS’ is closed to new topics and replies.
The forums ran from 2008-2020 and are now closed and viewable here as an archive.
How is it possible to maintain the position of an image and “grow” it on hover/mouseover. Every time I try to do this it affects the position of other elements around it. I want to have an effect like on Google+ image gallery:
https://plus.google.com/photos/107671704413122133444/albums/5646888504254171681
your prolly going to have to use a combination of js and absolute positioning
Here’s a quick starting point for you that doesn’t require absolute positioning or JavaScript:
But, if you want something as complex as your Google+ example, you are going to need some JS (at least for browser compatibility).
EDIT: Updated with CSS transitions: http://jsfiddle.net/qG8Hp/1/
EDIT: One more update (couldn’t resist): http://jsfiddle.net/qG8Hp/2/
I’m getting this issue where, even when the z-index is increased, the image appears over some elements, but under other elements.
JS solutions are welcome! Whatever will get the job done :)
@nilsw – http://jsfiddle.net/5hK3U/1/
You have to specify a position for z-index to work.
it was about positioning the container(li) relative and then on hover making the image position:absolute
yes! this makes sense now that I know z-index is tied to having the position attribute set.
Thanks Guys!
Ok, so the previous example worked great with fixed size images, but what happens if all the images are different sizes?
I’ve converted the previous example to use varied image sizes, and JS to adjust for any image size and grow 10% in each direction. BUT, the problem, if the list items don’t have fixed sizes, then the grow effect moves everything around.
How can I keep things in one place with varying image sizes (& fixed height)?