JQuery namespaces not working
See original GitHub issueThis is a (multiple allowed):
-
bug
-
enhancement
-
feature-discussion (RFC)
-
Framework7 Version: 1.5.4
-
Platform and Target: Browser
-
Live Link or JSFiddle/Codepen: _
What you did
Inside the page:init I defined this event,
$$('body').on('click.roomtype', '.elem', function () { console.log('elem clicked'); var classes = $$(this).attr('class').split(' '); var id = classes[1]; console.log(id); });
Expected Behavior
I have a list block generated with Template7, and a click on one of those elements should trigger the click event and log its id.
Actual Behavior
No click event is triggered. If I remove the namespace ( .roomtype) it will work, but will also add multiple calls to that click. I can use .off() to stop this last behaviour, but it would require namespacing to work with anonymous functions (note: Anonymous functions are a must).
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (1 by maintainers)
Top GitHub Comments
OnPageInit should receive a page object with includes a container property. Handlers ect should be attached to that not body (thus effecting only that one page)
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.