我得到了这个画廊。当您悬停图像时,我想应用放大镜(或其他东西),因此用户可以轻松看到图像可以变大。我想要的效果和这个差不多。
我一直在寻找 wordpress 中的不同文件,我的问题是我无法
<span class="roll" ></span>
在链接中添加图像。
如果有人知道如何做到这一点,请告诉。:-)
谢谢。
我把它放在了footer.php
<script>
//$('a.image:link').prepend('<span class="roll"></span>');
$('.gallery-icon a:link').each(function() {
$(this).prepend('<span class="roll"></span>');
// OR
//$(this).wrapInner('<span class="roll"></span>');
});
</script>
<script>
$(function() {
// OPACITY OF BUTTON SET TO 0%
$(".roll").css("opacity","0");
// ON MOUSE OVER
$(".roll").hover(function () {
// SET OPACITY TO 70%
$(this).stop().animate({
opacity: .7
}, "slow");
},
// ON MOUSE OUT
function () {
// SET OPACITY BACK TO 50%
$(this).stop().animate({
opacity: 1
}, "slow");
});
});
</script>
这在css中。
span.roll {
background:url(images/zoom.png) center center no-repeat #000;
height: 120px;
position: absolute;
width: 150px;
z-index: 7000;
-webkit-box-shadow: 0px 0px 4px #ff0066;
-moz-box-shadow: 0px 0px 4px #ff0066;
box-shadow: 0px 0px 4px #ff0066;
}
当我从我的 webdeveloper 查看代码时,它看起来像这样:
就像 wordpress 覆盖了我所有的 css 等等。