//添加新元素事件后,重新绑定 //unbind(); //bind(); //解决jquery新建的元素事件绑定问题,实现rebind()功能 function bind(){ $("a[name='columnSel']").bind("click",function(){ $("#postfid").attr("value",$(this).text()); $("input[name='typeid']").attr("value",$(this).attr('id')); //关闭窗口 $("#windownbg").remove(); $("#windown-box").fadeOut("fast",function(){ $(this).remove(); }); });} function unbind(){ $("a[name='columnSel']").unbind("click"); } bind();