有没有人知道除了创建两个独立的图像和改变src之外,是否有一种方法可以使图像在悬停时变得灰度化。
谢谢
编辑-半工作代码...:
<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="scripts/pixastic-1.custom.js"></script>
<script type="text/javascript">
$(document).ready(function() {
var img = $(".test img")
$('.test').hover(function() {
$('img', this).pixastic("desaturate");
}, function() {
$(this).html(img);
});
});
</script>和
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/family_woods.jpg" width="100" height="100" alt="" />
</div>如果页面上有多个div,我如何修改它才能工作……像这样..。
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/family_woods.jpg" width="100" height="100" alt="" />
</div>
<div class="test" style="padding:25px; width:200px; background-color:#F96">
<img class="pic" src="images/home/mainImage/another_image.jpg" width="100" height="100" alt="" />
</div>发布于 2010-10-09 23:36:42
作为jQuery的一种替代方案,我认为可以在flash中使用一个简单的flash动画来处理鼠标经过等等,这样就可以在flash中将图像灰度化,而不是隐藏实际的图像源或拥有2张图像。
这看起来很有价值:http://www.flashcomponents.net/component/as2_luminosity_gray_scale_utility.html
与此组件完全无关...
https://stackoverflow.com/questions/3896140
复制相似问题