沒有人知道是否有辦法在懸停時創建圖像灰度 - 除了創建2個獨立的圖像和更改src。懸停上的jquery灰度
感謝
編輯 - SEMI的工作代碼...:
<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>
可能的解決方案:http:// stackoverflow。com/questions/2474333/jquery-convert-image-to-grayscale – Alec 2010-10-09 15:24:03
你可能想檢查這個演示: http://www.sohtanaka.com/web-design/examples/hover-over-trick/ – 2010-10-09 15:25:27
這是通過使用[兩張圖片](http://www.sohtanaka.com/web-design/examples/hover-over-trick/sushiandrobots_thumb.gif)。 – Alec 2010-10-09 15:27:25