爲此,我使用colorbox jQuery插件http://colorpowered.com/colorbox/和表單。我正嘗試使用jQuery colorbox取消隱藏包含表單的div
,並在點擊下面的相關鏈接時將其顯示在colorbox中。使用jQuery通過點擊鏈接取消隱藏div
這是我用的標題中的javascript:
$(document).ready(function() {
$('#password_reset').ajaxForm({
success: showResponse,
clearForm: 'true'
});
function showResponse(responseText, statusText) {
$('#password_reset').hide();
$('#formStatus').html(responseText);
};
$().bind('cbox_open', function() {
$('#password_reset').show();
$('#formStatus').html('');
});
$(".inline").colorbox({
width: "300px",
height: "250px",
inline: true,
href: "#password_change"
});
});
這是鏈接我有一個應該運行我的javascript代碼(上)和取消隱藏下方div和運行成顏色框:
<a href="javascript:showResponse">Password Reset</a>
這是我隱藏的div:
<div style="visibility: hidden;">
<div id='password_change' style="padding:10px; background:#fff;">
<strong>Change your password</strong><br /><br />
<form id="password_reset" action="password_reset.php" method="post">
<input type="hidden" name="Method" value="updatePassword" />
Password: <br />
<input type="password" name="password1" />
<br />
<br />
Verify Password: <br />
<input type="password" name="password2" />
<br />
<input type="submit" value="Update" />
</form>
<div id="formStatus"></div>
</div>
</div>
希望有人可以告訴我如何讓這個工作,因爲我完全卡住,我知道這是一個小錯誤,我在這裏,但我無法弄清楚。請幫忙?
你好感謝你的嘗試,但我想你的建議,幷包含遺體形式的股利與知名度設置爲隱藏當我點擊鏈接:( – 2010-09-17 06:20:06