Is there a way to dynamically scale up an image when hovered over? I'm trying to achieve an effect where the image increases from 100x75 pixels to 300x225 pixels. Everything seems to be working fine with the layout, but the width doesn't seem to scale up properly when hovered. Any suggestions on how to fix this issue would be greatly appreciated. Just to clarify, I want the image to not exceed the dimensions of 300x225 pixels.
CSS:
.hoverbox a .preview {
display: none;
}
.hoverbox a .preview img {
display: inline;
}
.hoverbox a:hover .preview {
display: block;
position: absolute;
top: -1em;
left: -2em;
z-index: 10;
border-width: 1px 1px 6px 1px;
border-style: solid;
border-color: #fff7ea;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-moz-box-shadow: 2px 2px 2px #161615;
-webkit-box-shadow: 2px 2px 2px #161615;
box-shadow: 2px 2px 2px #161615;
}
.hoverbox img {
background: #fff;
border-width: 1px 1px 6px 1px;
border-style: solid;
border-color: #fff7ea;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
-moz-box-shadow: 2px 2px 2px #161615;
-webkit-box-shadow: 2px 2px 2px #161615;
box-shadow: 2px 2px 2px #161615;
padding: 2px;
vertical-align: top;
width: 100px;
height: 75px;
}
.hoverbox li
{
background: transparent;
display: inline;
float: left;
margin: 3px;
padding: 5px;
position: relative;
}
.hoverbox .preview {
width: 300px;
height: 225px;
}
HTML:
<section>
<h1 class="headline">Feast your eyes.</h1>
<ul class="hoverbox">
<li>
<a href="#"><img src="200opt.jpg" alt="descr"/><img src="200opt.jpg" alt="description" class="preview" /></a>
</li>
</ul>
</section>
Thanks for the assistance!