我有一个来临/圣诞日历。每天都是另一张带有一扇门的照片。为了使这些区域可点击我用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