{"id":21893744,"url":"https://github.com/micc83/lazyresp","last_synced_at":"2026-05-18T00:02:32.706Z","repository":{"id":23802010,"uuid":"27178047","full_name":"micc83/lazyResp","owner":"micc83","description":"jQuery plugin to lazy load responsive images with retina support","archived":false,"fork":false,"pushed_at":"2014-12-12T15:47:09.000Z","size":428,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-27T04:09:37.374Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://codeb.it/lazyresp/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/micc83.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-26T13:29:22.000Z","updated_at":"2014-12-12T15:47:10.000Z","dependencies_parsed_at":"2022-07-16T17:30:36.949Z","dependency_job_id":null,"html_url":"https://github.com/micc83/lazyResp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/micc83/lazyResp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micc83%2FlazyResp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micc83%2FlazyResp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micc83%2FlazyResp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micc83%2FlazyResp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/micc83","download_url":"https://codeload.github.com/micc83/lazyResp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/micc83%2FlazyResp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33160167,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-11-28T13:16:31.285Z","updated_at":"2026-05-18T00:02:32.691Z","avatar_url":"https://github.com/micc83.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery lazyResp\n========\n\n**lazyResp** is a jQuery plugin with a very small footprint ( *~ 0.7 Kb Gzipped* ) that handle images loading on multiple screen resolution. Check the **demo** on the [official web page](http://codeb.it/lazyresp/) of the plugin.\n\n## How it works\n\nUsing **jQuery lazyResp** is pretty straightforward, just include the script in your page:\n```html\n\u003cscript src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"../jquery.lazyresp.js\"\u003e\u003c/script\u003e\n```\nThen initialize it on `$(window).load()` as follow:\n\n```html\n\u003cimg src=\"http://placehold.it/480x360\" height=\"250\" width=\"250\" class=\"lazyResp\"\n    data-small-retina=\"http://placehold.it/960x720\" \n    data-medium=\"http://placehold.it/1024x768\" \n    data-medium-retina=\"http://placehold.it/2048x1536\" \n    data-large=\"http://placehold.it/1920x1440\" \n    data-large-retina=\"http://placehold.it/2560x1920\"\u003e\n  \n...\n  \n\u003cscript type=\"text/javascript\"\u003e\n$(window).load(function() {\n  $('img.lazyResp').lazyResp();\n});\n\u003c/script\u003e\n```\nHere's the script options and default values:\n```javascript\n$('img.lazyResp').lazyResp({\n  medium: 640,    // Medium \u003e 640px\n  large: 1024,    // Large \u003e 1024px\n  retina: 1.01,   // Device pixel ratio to be considered retina \u003e= 1.01\n  tolerance: 0,   // Extend the viewport of 0px vertically and horizontally\n  lazy: true,     // If set to false disable lazy loading\n  beforeLoad: function (img) {},  // Do something before the right image is loaded\n  afterLoad: function (img) {}    // Do something after the right image is loaded\n});\n```\n**jQuery lazyResp** provide also a `refresh()` method to check if elements are in the viewport without having to scroll the page:\n```javascript\nvar lr = $('img.lazyResp').lazyResp();\n$('a.check').click(function (e) {\n  e.preventDefault();\n  lr.refresh();\n});\n```\nYou can also target a given image setting `lazy` to false in order to load the right image size on demand, here's an example using jQuery lazyResp with **jQuery owlCarousel**:\n```javascript\n$(document).ready(function() {\n  $(\"#owl-demo\").owlCarousel({\n    singleItem:true,\n    navigation : true,\n    afterInit: function () {\n      var $firstImage = $(this.owl.owlItems[0]).find('img');\n      $firstImage.lazyResp({lazy:false});\n    },\n    afterMove: function () {\n      var $currentImage = $(this.owl.owlItems[this.owl.currentItem]).find('img');\n      $currentImage.lazyResp({lazy:false});\n    }\n  });\n});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicc83%2Flazyresp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicc83%2Flazyresp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicc83%2Flazyresp/lists"}