How to install the widget
Add this to any page, and you're golden: (See the demo!)
<script src="https://widget.battleforthenet.com/widget.js" async></script>
Or, follow these easy instructions for Tumblr.
If you have any problems or questions regarding the widget, please submit an issue.
How it works
The widget is designed to appear once per user, per device, per day, but can be configured to display at a different interval. If you'd like to force it to show up on your page for testing, reload the page with
#ALWAYS_SHOW_BFTN_WIDGET at the end of the URL.
Please take a look at widget.js if you want to see exactly what you'll be embedding on your page.
- Compatible with Firefox, Chrome, Safari and Internet Explorer 11+.
- Optionally pass in customization parameters (see below), or defaults are used.
- Widget checks to make sure it should be shown (hasn't been shown to this user recently and user hasn't initiated a call or clicked a donate link recently, via cookie). You can override this check for testing purposes.
- Widget preloads any images required for the chosen animation.
- Widget injects a floating
iframeonto your page. All but the most trivial styles and interactions take place in the
- Animation displays in floating
- The user can dismiss the
iframeand a cookie is written so it won't show again until cookie expires (unless you override).
Modal customization options:
If you define an object called
_bftn_options before including the widget code,
you can pass some properties in to customize the default behavior.