I've readed and went trough all examples on:
- http://fancyapps.com/fancybox/
There is nothing to help me with making a pop-up login box.
I've checked the old version Fancybox 1.3.x which have an example for login box, but that method doesn't really work on new Fancybox v2.
If anyone can help me, I will be happy.
So far I have this code, which is semi-working:
$("#top-login-button").click(function() {
$.fancybox.open({
href : "#login_form",
padding : 0,
onClosed : function() {
$("#login_error").hide();
}
});
});
$("#login_form_ajax").bind("submit", function() {
if ($("#login_name").val().length < 1 || $("#login_pass").val().length < 1) {
$("#login_error").show();
return false;
}
$.fancybox.showActivity();
$.ajax({
type : "POST",
cache : false,
url : "/login.php",
data : $(this).serializeArray(),
success: function(data) {
$.fancybox(data);
}
});
return false;
});
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…