As you should know there is no way detach event that was added with anonymous function (like in your example). It works in jQuery because they use so called proxy funcs which is not best approach in my opinion. So you should use it like with native JS rules: --- function handleClick(e){ //do some stuff } $$('.container').on('click', 'a.item-link', handleClick); //to detach event $$('.container').off('click', 'a.item-link', handleClick);
The following registers fine: --- $$("#upPicsHolder").on('click', 'a.newImgDeleteBtn', deleteCurImg); --- However, I am having trouble with the following to de-register the click event --- $$("#upPicsHolder").off('click', 'a.newImgDeleteBtn', deleteCurImg); --- with Firebug, the following error message is displayed in the console when the second "off" statement is executed --- TypeError: Argument 2 of EventTarget.removeEventListener is not an object. Dom7.prototype.off() framework7.js (line 4666) this[j].removeEventListener(events[i], listener, false);
After further testing, it seems that F7 does not like this format for some reason --- $$(documentElement).off('click', 'a', functionName); --- The above seems to show the error message displayed above. The "on" function seems to register just fine. It's only the "off" function that does not work
Hi there, No, live events don't work like that, and at the moment there is no way to remove live event listener :( Just use usual events instead of live events here
This will be fixed in next update, already fixed in dev
Already fixed in 0.9.4