{"id":13500872,"url":"https://github.com/garand/sticky","last_synced_at":"2025-10-22T18:38:58.209Z","repository":{"id":45728265,"uuid":"1364093","full_name":"garand/sticky","owner":"garand","description":"jQuery Plugin for Sticky Objects","archived":true,"fork":false,"pushed_at":"2019-11-13T13:09:12.000Z","size":612,"stargazers_count":3282,"open_issues_count":173,"forks_count":1043,"subscribers_count":102,"default_branch":"master","last_synced_at":"2025-09-24T23:38:35.870Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-02-14T05:36:09.000Z","updated_at":"2025-09-16T14:26:40.000Z","dependencies_parsed_at":"2022-09-15T01:11:53.918Z","dependency_job_id":null,"html_url":"https://github.com/garand/sticky","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/garand/sticky","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garand%2Fsticky","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garand%2Fsticky/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garand%2Fsticky/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garand%2Fsticky/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garand","download_url":"https://codeload.github.com/garand/sticky/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garand%2Fsticky/sbom","scorecard":{"id":418629,"data":{"date":"2025-08-11","repo":{"name":"github.com/garand/sticky","commit":"73b0fbe38c5f6371ae3dfaa66eb836fabc0a4aec"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"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":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":6,"reason":"Found 14/21 approved changesets -- score normalized to 6","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":"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":"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":"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":"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":"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":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Warn: project license file does not contain an FSF or OSI license."],"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 23 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-19T00:35:58.748Z","repository_id":45728265,"created_at":"2025-08-19T00:35:58.748Z","updated_at":"2025-08-19T00:35:58.748Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":277446625,"owners_count":25819183,"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-09-28T02:00:08.834Z","response_time":79,"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":[],"created_at":"2024-07-31T22:01:17.423Z","updated_at":"2025-09-29T01:30:37.766Z","avatar_url":"https://github.com/garand.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","13. 页面交互","Programming Languages"],"sub_categories":["13.15 固定元素(Sticky) ###","JavaScript","13.15 固定元素(Sticky)"],"readme":"# Sticky\n\nSticky is a jQuery plugin that gives you the ability to make any element on your page always stay visible.\n\n## Sticky in brief\n\nThis is how it works:\n\n- When the target element is about to be hidden, the plugin will add the class `className` to it (and to a wrapper added as its parent), set it to `position: fixed` and calculate its new `top`, based on the element's height, the page height and the `topSpacing` and `bottomSpacing` options.\n- That's it. \nIn some cases you might need to set a fixed width to your element when it is \"sticked\".\nBut by default (`widthFromWrapper == true`) sticky updates elements's width to the wrapper's width.\nCheck the `example-*.html` files for some examples.\n\n## Usage\n\n- Include jQuery \u0026 Sticky.\n- Call Sticky.\n\n```html\n\u003cscript src=\"jquery.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"jquery.sticky.js\"\u003e\u003c/script\u003e\n\u003cscript\u003e\n  $(document).ready(function(){\n    $(\"#sticker\").sticky({topSpacing:0});\n  });\n\u003c/script\u003e\n```\n\n- Edit your css to position the elements (check the examples in `example-*.html`).\n\n- To unstick an object\n\n```html\n\u003cscript\u003e\n  $(\"#sticker\").unstick();\n\u003c/script\u003e\n```\n\n## Options\n\n- `topSpacing`: (default: `0`) Pixels between the page top and the element's top.\n- `bottomSpacing`: (default: `0`) Pixels between the page bottom and the element's bottom.\n- `className`: (default: `'is-sticky'`) CSS class added to the element's wrapper when \"sticked\".\n- `wrapperClassName`: (default: `'sticky-wrapper'`) CSS class added to the wrapper.\n- `center`: (default: `false`) Boolean determining whether the sticky element should be horizontally centered in the page.\n- `getWidthFrom`: (default: `''`) Selector of element referenced to set fixed width of \"sticky\" element.\n- `widthFromWrapper`: (default: `true`) Boolean determining whether width of the \"sticky\" element should be updated to match the wrapper's width. Wrapper is a placeholder for \"sticky\" element while it is fixed (out of static elements flow), and its width depends on the context and CSS rules. Works only as long `getWidthForm` isn't set.\n- `responsiveWidth`: (default: `false`) Boolean determining whether widths will be recalculated on window resize (using getWidthfrom).\n- `zIndex`: (default: `inherit`) controls z-index of the sticked element.\n\n## Methods\n\n- `sticky(options)`: Initializer. `options` is optional.\n- `sticky('update')`: Recalculates the element's position.\n\n## Events\n\n- `sticky-start`: When the element becomes sticky.\n- `sticky-end`: When the element returns to its original location\n- `sticky-update`: When the element is sticked but position must be updated for constraints reasons\n- `sticky-bottom-reached`: When the element reached the bottom space limit\n- `sticky-bottom-unreached`: When the element unreached the bottom space limit\n\nTo subscribe to events use jquery:\n\n```html\n\u003cscript\u003e\n  $('#sticker').on('sticky-start', function() { console.log(\"Started\"); });\n  $('#sticker').on('sticky-end', function() { console.log(\"Ended\"); });\n  $('#sticker').on('sticky-update', function() { console.log(\"Update\"); });\n  $('#sticker').on('sticky-bottom-reached', function() { console.log(\"Bottom reached\"); });\n  $('#sticker').on('sticky-bottom-unreached', function() { console.log(\"Bottom unreached\"); });\n\u003c/script\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarand%2Fsticky","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarand%2Fsticky","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarand%2Fsticky/lists"}