{"id":13750212,"url":"https://github.com/paveisistemas/ionic-image-lazy-load","last_synced_at":"2025-10-22T19:53:56.711Z","repository":{"id":21343823,"uuid":"24660834","full_name":"paveisistemas/ionic-image-lazy-load","owner":"paveisistemas","description":"Directive to Ionic Framework that only loads an image when it is seen by the user. ","archived":false,"fork":false,"pushed_at":"2016-08-15T14:05:13.000Z","size":40,"stargazers_count":365,"open_issues_count":27,"forks_count":116,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-23T13:05:39.120Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://codepen.io/pavei/pen/oFpCy","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paveisistemas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-01T00:37:43.000Z","updated_at":"2024-12-02T18:13:46.000Z","dependencies_parsed_at":"2022-08-21T00:10:30.014Z","dependency_job_id":null,"html_url":"https://github.com/paveisistemas/ionic-image-lazy-load","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveisistemas%2Fionic-image-lazy-load","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveisistemas%2Fionic-image-lazy-load/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveisistemas%2Fionic-image-lazy-load/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paveisistemas%2Fionic-image-lazy-load/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paveisistemas","download_url":"https://codeload.github.com/paveisistemas/ionic-image-lazy-load/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253275609,"owners_count":21882336,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T08:00:23.954Z","updated_at":"2025-10-22T19:53:51.675Z","avatar_url":"https://github.com/paveisistemas.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","And A Bunch More! (I am in the process of sorting these)"],"sub_categories":[],"readme":"ionic-image-lazy-load\n=====================\n\n\n## Demo\nhttp://codepen.io/mvidailhet/pen/yNOGzY\nhttp://codepen.io/pavei/pen/oFpCy\n\n## Quick Start\n\nInstall using bower\n\n```sh\nbower install ion-image-lazy-load --save\n```\n\nor\n\n\nDownload the file JS *ionic-image-lazy-load.js*, save on your project and load it on your *index.html*.\n\n\n```html\n\u003cscript src=\"path/to/ionic-image-lazy-load.js\"\u003e\u003c/script\u003e\n```\n\nLoad into your module:\n\n```javascript\nangular.module('yourapp',\n              ['ionic', 'ionicLazyLoad'])\n```\n\nSet the `lazy-scroll` directive on your `\u003cion-content\u003e` tag, that will listen to the scroll event:\n\n``` javascript\n\u003cion-content lazy-scroll\u003e\n```\n\nAnd set the `image-lazy-src` directive on the image attribute instead of `src`:\n\n```javascript\n \u003cimg image-lazy-src=\"{{item.thumbnail}}\"\u003e\n```\n\nYou can also use it as a background-image for an element by setting the `image-lazy-background-image` paramameter to true:\n``` javascript\n\u003cdiv image-lazy-src=\"{{item.thumbnail}}\" image-lazy-background-image=\"true\"\u003e\u003c/div\u003e\n```\n\nYou can also set an option to auto call `$ionicScrollDelegate.resize()` when the image `load` (default value is `false`):\n\n```javascript\n \u003cimg image-lazy-src=\"{{item.thumbnail}}\" lazy-scroll-resize=\"true\"\u003e\n```\n\nTo show a ionic spinner while the image is loading, just specify a ionic spinner type (list is here: http://ionicframework.com/docs/api/directive/ionSpinner/):\n\n```javascript\n \u003cimg image-lazy-src=\"{{item.thumbnail}}\" image-lazy-loader=\"lines\"\u003e\n```\nNote: the styling of the loader position is up to you. The directive adds this html:\n\n```html\n\u003cdiv class=\"image-loader-container\"\u003e\n    \u003cion-spinner class=\"image-loader\" icon=\"#spinnerStyle#\"\u003e\u003c/ion-spinner\u003e\n\u003c/div\u003e\n```\n\nYou can set a distance from the bottom or right side of the screen where the image will start loading.\nThis will allow to start loading the image 100px below the bottom of the screen:\n\n``` javascript\n \u003cimg image-lazy-src=\"{{item.thumbnail}}\" image-lazy-distance-from-bottom-to-load=\"100\"\u003e\n```\n\nThis will allow to start loading the image 100px before the right side of the screen:\n```javascript\n \u003cimg image-lazy-src=\"{{item.thumbnail}}\" image-lazy-distance-from-right-to-load=\"100\"\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveisistemas%2Fionic-image-lazy-load","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaveisistemas%2Fionic-image-lazy-load","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaveisistemas%2Fionic-image-lazy-load/lists"}