使用jQuery時,不能進行事件的綁定
?$('.overlap').on('click',function(){
? ? showNote(false);
? ? })
? ? function showNote(show){
? ? if(show){
? ? $(".overlap").css('display','block');
? ? $(".notedetail").css('display','block');
? ? }
? ? else{
? ? $(".overlap").css('display','none');
? ? $(".notedetail").css('display','none');
? ? }
? ? }
? ? function bindClassEvent(){
? ? $("#classes").delegate('li','click',function(){
? ? showNote(true);
? ? })
? ? }
bindClassEvent();
2017-09-03
不要用deledgate