{"id":32258119,"url":"https://github.com/alexanderdickson/waitforimages","last_synced_at":"2025-10-22T19:43:15.664Z","repository":{"id":1380340,"uuid":"1334165","full_name":"alexanderdickson/waitForImages","owner":"alexanderdickson","description":"A jQuery plugin that lets you attach callbacks to useful image loading events. ","archived":false,"fork":false,"pushed_at":"2022-05-30T09:26:01.000Z","size":249,"stargazers_count":1297,"open_issues_count":4,"forks_count":182,"subscribers_count":43,"default_branch":"master","last_synced_at":"2025-09-22T17:27:14.493Z","etag":null,"topics":["jquery-plugin"],"latest_commit_sha":null,"homepage":"http://alexanderdickson.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"deprecate/hub.me","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexanderdickson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-MIT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-06T11:42:34.000Z","updated_at":"2025-09-16T02:12:18.000Z","dependencies_parsed_at":"2022-08-16T13:15:12.279Z","dependency_job_id":null,"html_url":"https://github.com/alexanderdickson/waitForImages","commit_stats":null,"previous_names":[],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/alexanderdickson/waitForImages","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderdickson%2FwaitForImages","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderdickson%2FwaitForImages/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderdickson%2FwaitForImages/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderdickson%2FwaitForImages/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexanderdickson","download_url":"https://codeload.github.com/alexanderdickson/waitForImages/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexanderdickson%2FwaitForImages/sbom","scorecard":{"id":180434,"data":{"date":"2025-08-11","repo":{"name":"github.com/alexanderdickson/waitForImages","commit":"8deab42355a45f2649c2d0b60994a15efdd17e8a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":3,"reason":"Found 6/20 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-MIT:0","Info: FSF or OSI recognized license: MIT License: LICENSE-MIT:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T18:45:53.071Z","repository_id":1380340,"created_at":"2025-08-16T18:45:53.071Z","updated_at":"2025-08-16T18:45:53.071Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280503073,"owners_count":26341692,"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","status":"online","status_checked_at":"2025-10-22T02:00:06.515Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["jquery-plugin"],"created_at":"2025-10-22T19:43:13.512Z","updated_at":"2025-10-22T19:43:15.657Z","avatar_url":"https://github.com/alexanderdickson.png","language":"JavaScript","funding_links":["http://paypal.me/alexwilliamdickson"],"categories":[],"sub_categories":[],"readme":"# waitForImages\n\nCopyright (c) 2011-2018 Alexander Dickson [@alexdickson](http://twitter.com/alexdickson)\n\nLicensed under the [MIT licenses](https://raw.github.com/alexanderdickson/waitForImages/master/LICENSE-MIT).\n\n[http://alexanderdickson.com](http://alexanderdickson.com)\n\n[Donate!](http://paypal.me/alexwilliamdickson)\n\n\n[![Build Status](https://secure.travis-ci.org/alexanderdickson/waitForImages.svg)](http://travis-ci.org/alexanderdickson/waitForImages)\n\n## Overview\n\nProvides useful callbacks once descendant images have loaded.\n\nwaitForImages also supports both images referenced in CSS, such as the `background-image` property, and images referenced in element attributes such as `srcset`. Images referenced in attributes can also be a comma-separated list of images.\n\nIt can be useful when WebKit incorrectly reports element dimensions/offsets on document ready, because it has not calculated their descendant `img` dimensions yet.\n\nSupports all browsers you probably care about.\n\n## Get it\n\nYou can either grab the source yourself...\n\n- [Production (minified)](https://raw.github.com/alexanderdickson/waitForImages/master/dist/jquery.waitforimages.min.js)\n- [Development (unminified)](https://raw.github.com/alexanderdickson/waitForImages/master/dist/jquery.waitforimages.js)\n\n...or you can use a hosted version...\n\n- [Hosted on CDNJS (minified)](http://cdnjs.cloudflare.com/ajax/libs/jquery.waitforimages/1.5.0/jquery.waitforimages.min.js)\n\nAlternatively, you can install with [`bower`](http://bower.io/)...\n\n```bash\nbower install waitForImages\n```\n\n...or [`npm`](https://www.npmjs.com/)...\n\n```bash\nnpm install jquery.waitforimages\n```\n\nOf course, these need to be loaded after `jQuery` is made available. The current version should be supported by at least jQuery 1.8, or perhaps earlier. If you find incompatibility issues, please check out a previous tagged version.\n\n## Usage\n\nThere are two ways to use waitForImages: with a standard callback system (previously the only API) or receiving a promise.\n\n### Standard\n\nJust provide a callback function and it will be called once all descendant images have loaded.\n\n```javascript\n$('selector').waitForImages(function() {\n    // All descendant images have loaded, now slide up.\n    $(this).slideUp();\n});\n```\n\nYou can also use the jQuery promise API.\n\n```javascript\n$('selector').waitForImages().done(function() {\n    // All descendant images have loaded, now slide up.\n    $(this).slideUp();\n});\n```\n\nIn the callbacks, `this` is a reference to the collection that `waitForImages()` was called on.\n\n### Advanced\n\nYou can pass a second function as a callback that will be called for each image that is loaded, with some information passed as arguments.\n\n```javascript\n$('selector').waitForImages(function() {\n    alert('All images have loaded.');\n}, function(loaded, count, success) {\n   alert(loaded + ' of ' + count + ' images has ' + (success ? 'loaded' : 'failed to load') +  '.');\n   $(this).addClass('loaded');\n});\n```\n\nUsing the jQuery promises API, you can then use the `progress()` method to know when an individual image has been loaded.\n\n```javascript\n$('selector').waitForImages().progress(function(loaded, count, success) {\n   alert(loaded + ' of ' + count + ' images has ' + (success ? 'loaded' : 'failed to load') +  '.');\n   $(this).addClass('loaded');\n});\n```\n\nYou can also set the third argument to `true` if you'd like the plugin to iterate over the collection and all descendent elements, checking for images referenced in the CSS (by default, it looks at the `background-image`, `list-style-image`, `border-image`, `border-corner-image` and `cursor` properties). If it finds any, they will be treated as a descendant image.\n\nThe callback will be called on the successful **and** unsuccessful loading of the image. Check the third argument to determine the success of the image load. It will be `true` if the image loaded successfully.\n\nIf you want to skip the first argument, pass `$.noop` or alternatively, pass an object literal to the plugin, instead of the arguments individually.\n\n```javascript\n$('selector').waitForImages({\n    finished: function() {\n        // ...\n    },\n    each: function() {\n       // ...\n    },\n    waitForAll: true\n});\n```\n\nTo use this with the promise API, simply pass one argument, which is `waitForAll`.\n\n```javascript\n$('selector').waitForImages(true).done(function() {\n    // ...\n});\n```\n\nYou may also set the CSS properties that possibly contain image references yourself. Just assign an array of properties to the plugin.\n\n```javascript\n$.waitForImages.hasImgProperties = ['backgroundImage'];\n```\n\nwaitForImages also exposes two custom selectors, `img:has-src` and `img:uncached`, (both used in conjunction with the `img` selector), which allow you to select `img` elements with a valid `src` attribute or that are not already cached already by the browser, respectively.\n\n```javascript\n$('img').not(':has-src').remove();\n$('img:uncached').attr('title', 'Loading Image');\n```\n\n## Feedback\n\nPlease use the [Issues](https://github.com/alexanderdickson/waitForImages/issues) for any bugs, feature requests, etc.\n\nIf you're having problems using the plugin, [ask a question on Stack Overflow](http://stackoverflow.com/questions/tagged/waitforimages).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderdickson%2Fwaitforimages","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexanderdickson%2Fwaitforimages","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexanderdickson%2Fwaitforimages/lists"}