Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/antitim/iwd
JS starter
https://github.com/antitim/iwd
Last synced: about 2 months ago
JSON representation
JS starter
- Host: GitHub
- URL: https://github.com/antitim/iwd
- Owner: antitim
- License: mit
- Created: 2017-06-21T11:04:03.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-08-06T20:50:33.000Z (over 2 years ago)
- Last Synced: 2024-12-03T15:44:45.036Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 550 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# IWD (init with DOM) [![NPM version][npm-image]][npm-url]
## AboutThis script performs the function with the name specified in the attribute of the dom element in the context of this item.
Supported the start of the function even if the DOM Element has been added after initialization of the script (MutationObserver).
## Browser
- IE 10+
- Edge
- Firefox 14+
- Chrome 18+
- Safary 6+
- Opera 15+
- iOS Safari 6.1+
- Android Browser 4.4 +## Usage
```html
function time (params) {
var self = this; // DOM Element <div data-js="time"></div>
var seconds;params; // { data: { name: "Hi" }, class: "js", id: "megaId" }
setInterval(function () {
var dt = new Date();if (seconds !== dt.getSeconds()) {
self.innerText = dt.getHours() + ':' + dt.getMinutes() + ':' + dt.getSeconds();
}
seconds = dt.getSeconds();
}, 100)
}```
## Test
[](https://www.browserstack.com/)Thank you to [BrowserStack](https://www.browserstack.com/) for providing the infrastructure that allows to test in real browsers.
[Test](https://antitim.github.io/iwd/test/index.html)
## License
MIT © [antitim](http://vk.com/antitim)
[npm-image]: https://badge.fury.io/js/init-with-dom.svg
[npm-url]: https://npmjs.org/package/init-with-dom