さて、私は現在機能しているfancyboxを持っていますが、完全に正しく機能していません。それは実際のテキストリンクでのみ機能し、送信ボタンの上にある場合は機能しません。まあ、それが機能しないと言うべきではありません、むしろそれは機能し、ファンシーボックスは1秒以内に自動的に閉じます、または運が良ければ約1秒続きますが、開いたままになることはありません(テキストリンク)。
FBコード:
<script>
$(document).ready(function() {
$("#top-login-button").click(function() {
$.fancybox({
padding : 15,
href : "#login_form_ajax",
afterClose : function(){ // it was onClosed for v1.3.4
$("#login_error").hide();
}
}); // fancybox
}); //click
$("#login_form_ajax").bind("submit", function() {
if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) {
$("#login_error").show();
$.fancybox.update(); // it was $.fancybox.resize(); for v1.3.4
return false;
}
$.fancybox.showLoading(); // it was $.fancybox.showActivity(); for v1.3.4
$.ajax({
padding : 15,
type : "POST",
cache : false,
url : "anyPage.php?page=ajax",
data : $(this).serializeArray(),
success: function(data) {
$.fancybox(data);
}
});
return false;
}); // bind
}); // ready
</script>
Fancyboxのオープンリンク:
<a id="top-login-button" href="#login_form_ajax" rel="gallery">Open login form</a>
上記は動作します。以下のものは、自動的に機能して閉じます。
<a id="top-login-button" href="#login_form_ajax" style="text-decoration:none" title="X">
<input class="czas" type="submit" name="ajax" value="X"></a>
何か案は?私は途方に暮れています。