https://github.com/quantizor/angular-backgroundsizer
💗 angular 1 directive to automatically apply background sizing once an image is loaded
https://github.com/quantizor/angular-backgroundsizer
Last synced: 4 months ago
JSON representation
💗 angular 1 directive to automatically apply background sizing once an image is loaded
- Host: GitHub
- URL: https://github.com/quantizor/angular-backgroundsizer
- Owner: quantizor
- License: mit
- Created: 2014-03-22T05:00:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-22T01:47:51.000Z (over 10 years ago)
- Last Synced: 2025-01-17T01:35:03.466Z (6 months ago)
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
angular-backgroundSizer
=======================A directive to automatically apply background sizing once an image is loaded. Useful for dynamic images
without predefined aspect ratios.It will discreetly load the image into the DOM (invisible and absolute, so it doesn't jump the page),
take height measurements and then apply background-size 'contain', 'cover' or nothing. It also listens
to the window 'resize' event and appropriately adjusts the background-size if needed.Load it into your AngularJS app by including it in your module's dependency array like so:
````javascript
var app = angular.module('myModule', ['backgroundSizer']);
````Then use it like this:
````html````