我创建了一个下拉菜单。当您单击“联系”时,会出现一个巨大的联系框。当我单击“关闭”时,它消失了。此功能有效。
我需要的是在表单打开后取消绑定列表项,但一旦关闭,再次启用它。
代码如下。
jQuery(document).ready(function() {
jQuery("#header ul.menu li:last-child").addClass("open");
jQuery("#header ul.menu li.open").click(function() {
jQuery(this).unbind("click");
jQuery("#contact").animate({marginTop:'+=426px'}, 2000);
return false;
});
jQuery("#contact a#close").click(function() {
jQuery("#contact").animate({marginTop:'-=426px'}, 2000);
jQuery("#header ul.menu li:last-child").live("click", function() {
});
return false;
});
});