Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2014-11-22T01:47:51.000Z (about 10 years ago)
- Last Synced: 2024-11-16T08:35:58.107Z (about 1 month 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````