2014-02-14 76 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