Topic: Flipping card bug (not flipping)
KontYentE free asked 6 years ago
hi guys, After playing a lot with your flipping cards script, I noticed a few bugs that might happen depending on how you implement mdb.
In a simple environment flipping works well, however when you start adding more and more scripts and css exceptions it might happen that the flipping stops to react.
This happens because the click eventListener might easily (and will) be overwritten. This shouldn't happen but in many of my tests just happened due to the complexity of my project.
After looking around I noticed that the way you create the listener e(".rotate-btn").on(click, function() {
is by far the best way if the webpage gets complex.
After testing for a long time, I came across this solutions wich worked crossbrowser and avoided a few bugs to happen. e(window).on("click.rotate-btn", function() {
This way you set the listener at an higher position and guarantee that will difficultly be overwritten again.
Just try it out and let me know what you thing about it
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Opened
- ForumUser: Free
- Premium support: No
- Technology: MDB jQuery
- MDB Version: 4.6.1
- Device: Mac Book
- Browser: Chrome
- OS: iOS
- Provided sample code: Yes
- Provided link: No
Bartłomiej Malanowski staff commented 6 years ago
Do you have any example where we could the this issue recreated?