又是另一项“经典”效果,大家可以利用以下片段随时加以运用。
$(document).ready(function() { $(".thumbs img").fadeTo("slow", 0.6); // This sets the opacity of the thumbs to fade down to 60% when the page loads $(".thumbs img").hover(function() { $(this).fadeTo("slow", 1.0); // This should set the opacity to 100% on hover }, function() { $(this).fadeTo("slow", 0.6); // This should set the opacity back to 60% on mouseout }); });