Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/addyosmani/x-imager

Responsive images using Imager.js and Polymer
https://github.com/addyosmani/x-imager

Last synced: 23 days ago
JSON representation

Responsive images using Imager.js and Polymer

Awesome Lists containing this project

README

        

# <x-imager>

A [Polymer](http://polymer-project.org) element for responsive images with [Imager.js](https://github.com/BBC-News/Imager.js/)

> Maintained by [Addy Osmani](https://github.com/addyosmani).

## Demo

> [Check it live](http://addyosmani.github.io/x-imager/index.html).

## Installation

Install using [Bower](http://bower.io):

```shell
bower install x-imager
```

## Usage

1. Import Web Components' polyfill (platform.js)

```html

```

2. Import Custom Element:

```html

```

3. Start using it!

```html

```

## Options

Attribute | Options | Default | Description
--- | --- | --- | ---
`src` | *string* | `` | URL endpoint for images
`widths` | *space separated list* | `` | available image widths
`width` | *number* | `` | enforced size of the image placeholder
`selector` | *string* | `delayed-image-load` | used to locate your div placeholders
`class` | *string* | `` | Class name to give your resizable images
`resize` | *boolean* | `true` | update the src attribute of the relevant images
`lazyload` | *boolean* | `false` | Toggle the lazy load functionality
`scrollDelay` | *number* | `` | helps performance by setting a higher delay

## Examples:

```html

```

```html

```

```html

```

## License

[MIT License](http://opensource.org/licenses/MIT)