Comments (4)
Hello. The DOM necessarily needs to be changed since inputs must be wrapped with the switch code.
However in v2 I use
el.parentNode.insertBefore(wrapper, el)
(line 198)
Then attached listeners should still work. Sincerely don't know other ways to achieve it differently
from lc-switch.
Yeah I am using v2 (pretty neat, btw). The change event didn't trigger anymore after lc_switch loaded.
I changed your custom event then it works with the listener above even after replacing the DOM with new inputs later.
b153ae2
from lc-switch.
Thanks for the clarification, however $(document).on("change lcs-statuschange", 'input' ...
works if you place it in the demo.html file. Before and after the plugin initialization.
The "lcs-statuschange" event is correctly handled.
from lc-switch.
Yes it works fine, until you do something like $("input-container").html(newstuff);
Then it needs bubbles: true.
At least it did in my case. I can check it again outside of my site, to be sure. Thanks for the quick reply and the great switch.
from lc-switch.
Related Issues (15)
- classes on input element is removed on initialising HOT 3
- onclick event HOT 1
- jQuery Ui HOT 4
- Method to enable or disable switch HOT 1
- function lcs_toggle() doesn't exist HOT 1
- label with "for" attribute toggles the radio / checkbox but the switches do not change HOT 1
- Public Event Listener for input type checkbox that is unchecked
- Unsafe assignment to innerHTML HOT 3
- Is it possible to theme only one checkbox on a page ? HOT 1
- Typo on the homepage HOT 1
- Resizing the switch HOT 2
- jQuery's delegated becomes deprecated... HOT 3
- Method to toggle state HOT 1
- Addon-reviewers security risk HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lc-switch.