我有一個來臨/聖誕日曆。每天都是另一張帶有一扇門的照片。爲了使這些區域可點擊我用CSS和ID是這樣的:鼠標附近的圖像翻轉放大
CSS:
ul#doorregions {
list-style: none;
background: url(<?php echo($pictureoftheday); ?>) no-repeat 0 0;
position: relative;
width: 950px;
height: 575px;
margin: 0;
padding: 0;
}
ul#doorregionsli {
border: 0px ;
position: absolute;
}
#door1 {
left: 135px;
top: 192px;
width: 73px;
height: 116px;
}
#door2 {
left: 135px;
top: 192px;
width: 73px;
height: 116px;
}
HTML:
<ul id="doorregions">
<li id="door1">
<span><a href="<?php echo($december1); ?>">
<img src="blankpixel.gif" width="100%" height="100%">
</a></span></li>
<li id="door2">
<span><a href="<?php echo($december2); ?>">
<img src="blankpixel.gif" width="100%" height="100%">
</a></span></li>
</ul>
到目前爲止,一切工作正常。現在,一個圖像應該在翻轉時在鼠標光標附近顯示一個門,當它位於該區域上方時。我試過類似的東西:
#door1 a:hover {
display:block;
background-image: url(OTHERPICTURE1.jpg);
}
但是,如果其他圖片大於門區域,此方法不起作用。任何其他想法?我無法切分背景圖片,這不是一個選項。
沒有必要在該地區跟隨鼠標,位置可以固定。但是,第二張圖像應該只在鼠標在門上(或者在第二張圖片上)時纔會出現。
最好的解決辦法是這樣的:http://www.sohtanaka.com/web-design/fancy-thumbnail-hover-effect-w-jquery/
但在這種情況下,它是放大在同一picuture我只有空白的GIF。什麼是最聰明的想法?
這就是問題所在。這不是我想要的。切片圖像需要很多工作... – SurfingCat 2009-11-24 16:33:10
此腳本不切片圖像。在鼠標懸停時,計算將圖像的中間設置到門的中間位置。 – Mottie 2009-11-24 21:14:09