Comments (7)
Hello and thanks for reporting this. It was in the pipeline for way too long :)
TL;DR
See 665e671
You can now remove event listeners set by AnimateMe by calling unbind
on the instance.
You can also remove the classnames that AnimateMe set to your HTML elements by calling destroy
.
This is all in the README now.
To use these new methods, please update to the latest version by either downloading or reinstalling via NPM/Yarn.
Can you please let me know if this works for you?
from animateme.
Sorry, it wasn’t exactly clear what I was describing. I want the extension to be able to disable AnimateMe if it’s running on a site while it’s doing a screen capture, and if possible it could re-enable it once the screen capture is done. The custom events on window approach would work well (for sites that are using it and have updated to the latest version)!
from animateme.
Cool, thank you for being so responsive! Just to see if I’m getting this right…
- I would trigger 'animateme:destroy' before I was to disable it
- can I trigger 'animateme:start' once I’m done to re-enable it (will it maintain any custom settings from however it was originally initialized)?
from animateme.
Yes! :)
Just a note that It is animateme:enable
instead of animateme:start
.
from animateme.
Looks like a nice improvement. However, my ulterior motive for bringing this up was the desire to be able to disable AnimateMe in a decoupled manner, in order to screenshot a page across multiple scroll positions without the animations getting in the way while I scroll (for this project).
If I could do something like this, that’d be awesome.
var event = new CustomEvent('animateme__disable');
window.dispatchEvent(event);
and then in the code maybe there's something like the following inside bind
:
this.win.addEventListener('animateme__disable', this.destroy.bind(this), false)
This might be too specific of a use-case, but if you don’t ask, the answer is always no
from animateme.
Since I cannot see your initialization of AnimateMe (because it is in a private branch/fork), I am not sure what exactly is the use case so I will try to guess
My guess is that you do not have access to the instance of AnimateMe and this is the reason why you need a custom event.
If that is not the case, you can refer to your instance and call destroy
at any time. This is shown in the README.
If not, I will implement custom events for destroying and re-starting.
I am thinking of something like the code you wrote above: animateme:disable
and animateme:enable
.
These two events will be bound to the window
object and in order to use them, you must dispatch a new event on the window
object.
How does that sound?
from animateme.
This is now implemented and published on Github and NPM.
Please refer to the README for more info, although you already know how to do it
Let me know if there is anything else i can do for you.
from animateme.
Related Issues (20)
- Action Required: Fix Renovate Configuration
- CVE-2021-23337 (High) detected in lodash-4.17.20.tgz
- CVE-2020-28500 (Medium) detected in lodash-4.17.20.tgz
- CVE-2021-23343 (Medium) detected in path-parse-1.0.6.tgz
- CVE-2020-28469 (Medium) detected in glob-parent-5.1.1.tgz
- CVE-2021-33502 (High) detected in normalize-url-4.5.0.tgz, normalize-url-3.3.0.tgz
- Dependency Dashboard
- CVE-2021-3807 (Medium) detected in ansi-regex-4.1.0.tgz
- CVE-2021-35065 (High) detected in glob-parent-5.1.2.tgz
- CVE-2021-44907 (Medium) detected in qs-6.10.1.tgz
- CVE-2021-44906 (Medium) detected in minimist-1.2.5.tgz
- Predefined animations HOT 1
- CVE-2019-10744 (High) detected in lodash-4.17.11.tgz
- CVE-2019-20149 (Medium) detected in multiple libraries
- CVE-2015-9251 (Medium) detected in jquery-1.11.1.min.js, jquery-1.12.4.min.js
- CVE-2019-11358 (Medium) detected in jquery-1.11.1.min.js, jquery-1.12.4.min.js
- WS-2016-0090 (Medium) detected in jquery-1.11.1.min.js, jquery-1.12.4.min.js
- CVE-2020-7608 (Medium) detected in yargs-parser-10.1.0.tgz
- WS-2020-0068 (High) detected in yargs-parser-10.1.0.tgz
- WS-2020-0070 (High) detected in lodash-4.17.15.tgz
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 animateme.