2014-02-14 77 views
1

我想改变,当我点击图像时,悬停图像的位置。现在*图像悬停在底部放大,我想在顶部放大(请参阅图像链接)。 我加入这个代码:变焦位置悬停

HTML:

<div class="image"></div> 

CSS:

.image { background:url(image url); height:50px; width:50px; } 

.image:hover { background:url(image url); height:400px; width:400px; } 

图片:

回答

0

试试这个

URL(http://www.url.com):
.image:hover { 
cursor: pointer; 
height:400px; 
width: 400px; 
transform:scale(1.5); 
-ms-transform:scale(1.5); /* IE 9 */ 
-moz-transform:scale(1.5); /* Firefox */ 
-webkit-transform:scale(1.5); /* Safari and Chrome */ 
-o-transform:scale(1.5); /* Opera */ 
} 

它的工作原理..

+0

我有固定与此:图像配:{ 背景悬停 height:500px; width:400px; margin-top:-250px; 颜色:透明; } – user3309614

+0

好的,但你不需要再次调用图像,如果你使用不同的图像,你可以使用它其他不必要的:) – raj