嗨淡入淡出我使用此代碼顯示在輸入焦點隱藏的div顯示隱藏DIV&密切與焦點輸入
這裏是HTML,請看看@jsfiddle也
<div id="divone">
<input class="url_field" />
</div>
<div id="first" class="content">
First
<input class="close" type="button" value="X"/>
</div>
<div id="last" class="content">
Last
<input class="close" type="button" value="X"/>
</div>
JavaScript代碼段:
$(document).ready(function() {
$(".url_field").focus(function() {
$(this).next(".content").fadeout('slow').css('display', 'inline');
});
$('.url_field').focus(function() {
$('.content').hide();
$('#' + this.rel + '').show();
return false;
});
$('.content input.close').click(function() {
$(this).parent().hide();
});
});
請幫幫我,它不工作
使用'在你的退出中,不是嗎? ) – raina77ow
沒有元素'.showdiv' – algorhythm
使用您的瀏覽器的JavaScript控制檯來查看錯誤。有很多... – algorhythm