{"id":32265599,"url":"https://github.com/jerrylow/breakpoints","last_synced_at":"2026-02-21T07:02:14.553Z","repository":{"id":57282009,"uuid":"124193606","full_name":"jerrylow/breakpoints","owner":"jerrylow","description":"jQuery Responsive/Breakpoint Optimized Library.","archived":false,"fork":false,"pushed_at":"2020-12-22T19:17:48.000Z","size":26,"stargazers_count":15,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-01-22T22:46:35.720Z","etag":null,"topics":["breakpoint","breakpoints-library","jquery","responsive"],"latest_commit_sha":null,"homepage":null,"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/jerrylow.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":"2018-03-07T07:01:57.000Z","updated_at":"2024-04-16T20:42:51.000Z","dependencies_parsed_at":"2022-08-24T12:42:39.330Z","dependency_job_id":null,"html_url":"https://github.com/jerrylow/breakpoints","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/jerrylow/breakpoints","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerrylow%2Fbreakpoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerrylow%2Fbreakpoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerrylow%2Fbreakpoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerrylow%2Fbreakpoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jerrylow","download_url":"https://codeload.github.com/jerrylow/breakpoints/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jerrylow%2Fbreakpoints/sbom","scorecard":{"id":516164,"data":{"date":"2025-08-11","repo":{"name":"github.com/jerrylow/breakpoints","commit":"7fc230cd50a448680a1aa360d1e680cfe4e5c815"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"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":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","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":"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":"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE: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"}}]},"last_synced_at":"2025-08-20T01:52:43.752Z","repository_id":57282009,"created_at":"2025-08-20T01:52:43.752Z","updated_at":"2025-08-20T01:52:43.752Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29675916,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T06:23:40.028Z","status":"ssl_error","status_checked_at":"2026-02-21T06:23:39.222Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["breakpoint","breakpoints-library","jquery","responsive"],"created_at":"2025-10-22T21:16:55.121Z","updated_at":"2026-02-21T07:02:14.548Z","avatar_url":"https://github.com/jerrylow.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Breakpoints\n\n\n## What is this?\n\nBreakpoints is a light weight jQuery library to detect and manage breakpoint changes. Breakpoint was originally written to optimize large single page sites with too many binds on `resize` causing performance issues. While still achieving the previous goal it has also been re-written to assist with general breakpoint management.\n\n[Demo](http://jerrylow.com/jquery-breakpoints/)\n\n\n## How to use\n\nInclude breakpoints library after jQuery, then initialize globally or on any page you want to use breakpoints.\n\n```js\n$(document).ready(function() {\n  $(window).breakpoints();\n});\n```\n\nBind to window's event `breakpoint-change` and listen for breakpoint changes or bind to one of the compare triggers to react to specific breakpoints.\n\n\n## Package Managers\n\n### Bower\n\n```\nbower install jquery-breakpoints\n```\n\n### NPM\n\n```\nnpm install jquery-breakpoints\n```\n\n\n## Examples\n\n### Listening for Breakpoint Changes\n\nBreakpoints will trigger `breakpoint-change` when the viewport enters a new breakpoint. The returned event will include `from` and `to` on event indicating the previous and new breakpoint.\n\n```js\n// Basic Bind\n$(window).bind(\"breakpoint-change\", function(event) {\n  console.log(event.from, event.to);\n});\n\n// Example Usage\n$(window).bind(\"breakpoint-change\", function(event) {\n  if (event.to === \"md\") {\n    ...\n  }\n});\n```\n\n### Listening for Specific Breakpoints Then Execute\n\nBreakpoints will trigger compare triggers followed by the breakpoint name. All of the [comparing methods](#comparing-methods) have a trigger with the _exception_ of `lessThanEqual` which conflicts with `greaterThanEqual`. Compare triggers will send on initializing.\n\n```js\n$(window).on('lessThan-md', function() {\n  // Do something when viewport is less than 992px\n});\n\n$(window).on('greaterEqualTo-md', function() {\n  // Do something when viewport is greater or equal to 992px\n});\n\n$(window).on('inside-md', function() {\n  // Do something when viewport is greater or equal to 992px BUT less than 1200px\n});\n```\n\n### Customize Breakpoints\n\nSet breakpoints based on website/application needs. Note the naming will change the the compare triggers.\n\n```js\n\n$(window).breakpoints({\n  breakpoints: [{\n    \"name\": \"phone\",\n    \"width\": 0\n  }, {\n    \"name\": \"phone-large\",\n    \"width\": 420\n  }, {\n    \"name\": \"tablet\",\n    \"width\": 768\n  }, {\n    \"name\": \"desktop\",\n    \"width\": 1024\n  }, {\n    \"name\": \"desktop-large\",\n    \"width\": 1340\n  }]\n});\n\n// Compare Trigger\n$(window).on('greaterEqualTo-desktop', function() {\n  // Do something when viewport is greater or equal to 1024px\n});\n```\n\n### Use Namespacing\n\nUsing namespaces will allow unbinding of specific `breakpoint-change` if necessary.\n\n```js\n$(window).bind(\"breakpoint-change.megamenu\", function(event) {\n  // Will get unbound\n});\n\n$(window).bind(\"breakpoint-change.footer\", function(event) {\n  // Won\"t get unbound\n});\n\n$(window).unbind(\"breakpoint-change.megamenu\");\n```\n\n### Comparing Specific Breakpoints\n\nChecking against the current breakpoint and if it matches the criteria execute the callback function. This method is **not** constantly listening for changes, it's a one time check. For constant check see _Constant Check Example_ below or use [comparing triggers](#listening-for-specific-breakpoints-then-execute). See [comparing methods](#comparing-methods) for all available options.\n\n```js\n// Basic Example\n$(window).breakpoints(\"lessThan\", \"md\", function() {\n  // If viewport is less than 992px do something here.\n});\n\n// Constant Check Example\n$(window).bind(\"breakpoint-change\", function(event) {\n  $(window).breakpoints(\"lessThan\", \"md\", function() {\n    ...\n  });\n});\n\n// Practical Usage Example\n$(\"button\").click(function() {\n  $(window).breakpoints(\"lessThan\", \"sm\", function() {\n    // Use a modal\n  });\n\n  $(window).breakpoints(\"greaterEqualTo\", \"md\", function() {\n    // Do something else\n  });\n});\n```\n\n\n## Options\n\n### breakpoints\n\n`array` `default:`\n```json\n[\n  {\n    \"name\": \"xs\",\n    \"width\": 0\n  }, {\n    \"name\": \"sm\",\n    \"width\": 768\n  }, {\n    \"name\": \"md\",\n    \"width\": 992\n  }, {\n    \"name\": \"lg\",\n    \"width\": 1200\n  }\n]\n```\n\nThese are the breakpoints to monitor. The default set is aligned with Bootstraps grid system. The width pertains to the lower limit. For example `992px` represents the beginning of `md` until it gets to `1200px`.\n\n### buffer\n\n`integer` `default: 300`\n\nA buffer is set before breakpoints trigger `breakpoint-change`. The buffer keeps resizing more performant by not triggering actions prematurely.\n\n### triggerOnInit\n\n`boolean` `default: false`\n\nOn initializing Breakpoints after the buffer trigger a `breakpoint-change` so all bindings necessary could happen. This will return the same event object as regular breakpoint change with `event.initalInit`.\n\n### outerWidth\n\n`boolean` `default: false`\n\nUse `$(window).outerWidth()` over the default `$(window).width()` for window width calculations.\n\n\n## Methods\n\n### getBreakPoint\n\nReturn the current breakpoint name.\n\n```js\n$(window).breakpoints(\"getBreakpoint\");\n```\n\n### getBreakpointWidth\n\nReturn the current breakpoint width given the break point name.\n\n```js\n$(window).breakpoints(\"getBreakpointWidth\", [breakpoint name]);\n```\n\n### destroy\n\nThis will stop ALL breakpoints from listening for changes. To remove a single breakpoint bind see [Use namespacing](#use-namespacing).\n\n```js\n$(window).breakpoints(\"destroy\");\n```\n\n\n## Comparing Methods\n\n### lessThan\n\nReturns true if the current viewport is less than the breakpoint.\n\n```js\n$(window).breakpoints(\"lessThan\", [breakpoint name], [callback]);\n```\n\n### lessEqualTo\n\nReturns `true` if the current viewport is less but also equal to the breakpoint value.\n\n```js\n$(window).breakpoints(\"lessEqualTo\", [breakpoint name], [callback]);\n```\n\n### greaterThan\n\nReturns `true` if the current viewport is greater than the breakpoint.\n\n```js\n$(window).breakpoints(\"greaterThan\", [breakpoint name], [callback]);\n```\n\n### greaterEqualTo\n\nReturns `true` if the current viewport is greater but also equal to the breakpoint.\n\n```js\n$(window).breakpoints(\"greaterEqualTo\", [breakpoint name], [callback]);\n```\n\n### inside\n\nReturns `true` if the current viewport is within the breakpoint and its lower limits. Eg. with the default breakpoints -- If the current viewport width is `900px` this would be `true` for `sm`. This will return `true` for the last (largest) breakpoint while the viewport width is greater than its value.\n\n```js\n$(window).breakpoints(\"inside\", [breakpoint name], [callback]);\n```\n\n\n## Minimum Requirements\n\nBreakpoints requires jQuery `v1.7` and up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerrylow%2Fbreakpoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjerrylow%2Fbreakpoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjerrylow%2Fbreakpoints/lists"}