我想要實現的是,當您將鼠標懸停在圖像上時,其不透明度將減少到一半。我必須在這裏做一個明顯的錯誤,但不知道究竟是什麼。任何提示將不勝感激。jQuery - 在鼠標懸停時減少圖像的不透明度
<a href="#" id="right-button"><img class="arrow" src="http://placekitten.com/200/200" alt="right" /></a>
$('.arrow').hover(
function() {
$(this).find('img').fadeTo('slow', 0.5);
},
function() {
$(this).find('img').fadeTo('slow', 1);
}
);
你需要包括jQuery和刪除.find() –
你也可以這樣做只是通過CSS不透明。 http://www.w3schools.com/css/css_image_transparency.asp – Sebsemillia