1.3.0 • Published 10 years ago

jquery-csswatch v1.3.0

Weekly downloads
4
License
BSD-2-Clause-Free...
Repository
github
Last release
10 years ago

jQuery csswatch event/plugin

http://github.com/leifcr/jquery-csswatch/

With jQuery css-watch, you can watch css changes

It uses requestAnimationFrame (webkitRequestAnimationFrame, mozRequestAnimationFrame, oRequestAnimationFrame, msRequestAnimationFrame) for polling and verifying if any changes to the CSS has been made for the given CSS attributes. It falls back to a timer in case the browser doesn't support requestAnimationFrame.

Documentation

For now, please see the tests and examples

Usage

This is both released as a bower component and a npm module, to suit whatever build tool/env you are using for your frontend.

Using npm

npm install jquery-csswatch
<script type="text/javascript" src="../node_modules/execute_method/dist/execute_method.js"></script>
<script type="text/javascript" src="../node_modules/jquery-csswatch/dist/jquery-csswatch.js"></script>

Using bower

Building

You need to setup grunt + npm to develop/build

  # install dependencies
  npm install

  # Build library, run unit tests and create minified version
  grunt

Examples

A working example can be found here: See http://leifcr.github.com/jquery-csswatch/examples/

Requirements

For building:
  • CoffeeScript 1.4 + (For building the library)

Development

Development is made in chrome and firefox on jQuery 1.8.2. Please fork, make a feature or bugfix branch and request a pull request. I'm sure there are bugs to be hunted down.

Testing

The library and unit tests needs to be built before testing. Direct compilation of coffeescript fails in some rare cases, and it's therefore better to compile before testing.

Currently these jQuery versions and browsers has been tested:

jQuery Versions

  • 1.8.2

Browsers Tested

  • Chrome 23
  • Chrome SxS/Canary (25.0.1337 (169859))
  • Internet Explorer 7,8,9
  • Firefox
  • Opera 11.6

Unit Tests

http://leifcr.github.com/jquery-csswatch/unit/

Release History

1.0 - (2012-11-22) Initial release

License

Copyright (c) 2012 Leif Ringstad Licensed under the freeBSD license.

Since it's free, please give me a thanks, beer, pizza, gadget or what you feel for.