Caliper is a combination of a few little scripts that I am using to detect your browser width and then trigger functions based on that size.
Grab the code from scripts.js and throw it in your code. Note that there is some blocking going on where I am assigning the resize and load events. If you don't like that, change it. I include scripts just before the body tag, and so far I haven't expereinced any load issues, that being said remember, IT. IS. BLOCKING.
- Chrome 34.0.1832.1 canary SyzyASan
- Chrome 32.0.1700.107 m
- Chrome 32.0.1700.99 (Android 4.4.0)
- Chrome iOS (tested with iPad Air and iPhone 5, not sure what version #)
- Firefox 26+ (Windows)
- Firefox 27 (Android)
- Firefox Nightly 30.0a1 (Windows)
- Opera Browser for Android
- Opera 15 (Windows)
- Amazon Silk (Kindle Fire HDX 7" and 8.9")
Maybe a plugin, maybe some clean up of the code. I may even add some retinafication to this to let you know your pixel density ratio.
Copyright (c) 2014 Phil Dutson (http://www.dutsonpa.com)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.