0
我有HTML代碼:如何更改對圖像懸停的影響?
<ul id="foo2">
<li>
<img src="images/dandb.png" width="238" height="132" title="<span class='link-hover'>Merit Direct</span></br><br/> Polished, high-impact content including whitepapers, research reports, blog articles, advertorials," alt="" />
</li>
<li>
<img src="images/demand_new.png" width="238" height="132" title="<span class='link-hover'>Merit Direct</span></br><br/> Polished, high-impact content including whitepapers, research reports, blog articles, advertorials," alt="" />
</li>
</ul>
,並在圖像的懸停我做了一個用波紋管腳本的滑動效果:通過運行此代碼對圖像懸停效果非常做
$(document).ready(function(){
var thumbs = $("#foo2 li img");
for (var i = 0, ii = thumbs.length; i < ii; i++){
if (thumbs[i].title && thumbs[i].title.length > 0)
{
var imgtitle = thumbs[i].title;
$(thumbs[i]).wrap('<div class="wrapperblue" />').
after('<div class=\'captionblue\'>' + imgtitle + '</div>').
removeAttr('title');
}
}
$('.wrapperblue').hover(
function(){
$(this).find('img').animate({opacity: "6"}, 200);
$(this).find('.captionblue').animate({top:"-309px"}, 350);
},
function(){
$(this).find('img').animate({opacity: "6"}, 200);
$(this).find('.captionblue').animate({top:"0px"},200);
}
);
});
快速。我希望該效果應該平滑,並且如果光標快速離開圖像懸停區域,那麼該效果應當在此時停止。它不能完成它的過渡。
我該怎麼做?
你有無效的HTML,屬性不能有它的HTML元素。但除此之外,只要將'200'改成更高的值,直到你滿意爲止。此外,您問題中的給定HTML不代表代碼? – putvande