0
當我單擊一個框時,單擊框的標題在更新不同元素的內容後消失。任何想法爲什麼?點擊框的內容應保持不變。更新不同元素後元素內容消失
HTML
<div id="school_left_box">
<p class="register_title">School</p>This is a box
</div>
<div id="representative_left_box">
<p class="register_title">Representative</p>This is a box
</div>
<p class="register_title form">Hello</p>
JQUERY
$(document).ready(function()
{
$("#school_left_box").click(function()
{
var title = $(".register_title", this);
$("#hidden_registration_type").html('School');
$(".register_title.form").html(title);
$("#register_right_box").fadeIn(300);
});
$("#representative_left_box").click(function()
{
var title = $(".register_title", this);
$("#hidden_registration_type").html('Representative');
$(".register_title.form").html(title);
$("#register_right_box").fadeIn(300);
});
});
恰到好處。感謝+1 – BentCoder