{"id":18809265,"url":"https://github.com/thingsym/jquery.background-fit","last_synced_at":"2025-04-13T20:25:19.790Z","repository":{"id":58222266,"uuid":"21606731","full_name":"thingsym/jquery.background-fit","owner":"thingsym","description":"Background Fit is a jQuery plugin that appear in sizes that fit to the aspect ratio of the background image.","archived":false,"fork":false,"pushed_at":"2022-02-21T07:18:45.000Z","size":474,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-05-01T20:22:57.288Z","etag":null,"topics":["jquery","plugin"],"latest_commit_sha":null,"homepage":"http://thingsym.github.io/jquery.background-fit/","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/thingsym.png","metadata":{"files":{"readme":"README-ja.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-07-08T09:22:05.000Z","updated_at":"2022-02-18T11:02:37.000Z","dependencies_parsed_at":"2022-08-31T02:00:53.198Z","dependency_job_id":null,"html_url":"https://github.com/thingsym/jquery.background-fit","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fjquery.background-fit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fjquery.background-fit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fjquery.background-fit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thingsym%2Fjquery.background-fit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thingsym","download_url":"https://codeload.github.com/thingsym/jquery.background-fit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223602618,"owners_count":17171952,"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":["jquery","plugin"],"created_at":"2024-11-07T23:15:49.040Z","updated_at":"2024-11-07T23:15:49.671Z","avatar_url":"https://github.com/thingsym.png","language":"JavaScript","readme":"# jQuery Plugin Background Fit\n\n「Background Fit」は、HTMLタグに設定した背景画像の縦横比率にぴったり合ったサイズで表示する jQuery プラグインです。\n\n\u003cimg src=\"./src/img/header.png\"\u003e\n\n\n## デモ\n\nデモは、 jquery.background-fit.js と background css の比較です。\n\n[Github Pages](http://thingsym.github.io/jquery.background-fit/)\n\n## つかいかた\n\n1. jQuery 本体の設定\n2. jquery.background-fit.js の設定\n3. HTMLと背景画像、CSSを用意\n4. Background Fit を適用\n5. 動作確認\n\n### 1. jQuery 本体の設定\n\njQuery (1.11 以上または \u003e= 3.x 以上) をページに読み込みます。\n\njquery.com から jQuery 本体をダウンロード。または CDN から配信している jQuery 本体を設定します。\n\n設定方法は「[Download jQuery](http://jquery.com/download/)」から。\n\n### 2. jquery.background-fit.js の設定\n\njquery.background-fit.js をページに読み込みます。\n\njquery.background-fit.min.js をダウンロードして、HTMLにスクリプトタグを以下のように設定します。\n\n```html\n\u003cscript src=\"http://DOMAIN/PATH/TO/jquery.background-fit.min.js\"\u003e\u003c/script\u003e\n```\n\n### 3. HTMLと背景画像、CSSを用意\n\n背景画像を表示するHTMLを用意します。id 属性または class 属性を設定すること。属性名はお好みで。\n\n```html\n\u003cdiv id=\"bg\"\u003ejquery.background-fit.js\u003c/div\u003e\n```\n\nCSSで背景画像を設定します。\n\n```css\n\u003cstyle\u003e\n#bg {\n\tbackground: url(http://DOMAIN/PATH/TO/sample.jpg);\n\tbackground-size: 100%;\n\tbackground-repeat: no-repeat;\n}\n\u003c/style\u003e\n```\n\n幅 (width) を設定すると、表示サイズが調整された表示になります。\n\n```css\n\u003cstyle\u003e\n#bg {\n\tbackground: url(http://DOMAIN/PATH/TO/sample.jpg);\n\tbackground-size: 100%;\n\tbackground-repeat: no-repeat;\n    width: 300px;\n    height: 300px;\n}\n\u003c/style\u003e\n```\n\n### 4. Background Fit を適用\n\nBackground Fit を適用する JavaScript を記述します。HTML に設定した id 属性または class 属性を セレクタに指定して Background Fit を適用します。\n\n```javascript\n\u003cscript\u003e\n$(function() {\n  $(\"#bg\").bg_fit();\n});\n\u003c/script\u003e\n```\n\n### 5. 動作確認\n\n表示を確認します。\n\n以上。\n\n## 動作条件\n\njQuery 1.11+ Or jQuery 2.x Or jQuery 3.x [http://jquery.com/download/](http://jquery.com/download/)\n\n## Contribution\n\n### Patches and Bug Fixes\n\nSmall patches and bug reports can be submitted a issue tracker in Github. Forking on Github is another good way. You can send a pull request.\n\n1. Fork [jQuery Plugin Background Fit](https://github.com/thingsym/jquery.background-fit) from GitHub repository\n2. Create a feature branch: git checkout -b my-new-feature\n3. Commit your changes: git commit -am 'Add some feature'\n4. Push to the branch: git push origin my-new-feature\n5. Create new Pull Request\n\n## Changelog\n\n* Version 0.0.6 - 2022-02-18\n\t* fix url for github pages\n\t* add .editorconfig\n\t* bump up jquery version to 3.6.0\n\t* fix gulpfile\n\t* update package.json\n\t* add css file\n\t* rename from examples to docs for github pages\n\t* remove bower.js\n\t* add LICENSE file\n* Version 0.0.5 - 2014-11-17\n\t* add bower.js\n* Version 0.0.4 - 2014-07-29\n\t* refactoring\n* Version 0.0.3 - 2014-06-12\n\t* fix in case of multiple setting\n* Version 0.0.2 - 2014-05-14\n\t* improve bgImg object\n* Version 0.0.1 - 2013-02-13\n\t* Initial release.\n\n## デモサンプル画像提供\n\n[写真素材 足成 - Ashinari Photo Material](http://www.ashinari.com)\n\n## License\n\nDual licensed under the MIT and [GPLv2](https://www.gnu.org/licenses/gpl-2.0.html) licenses.\n\n## Author\n\n[thingsym](https://github.com/thingsym)\n\nCopyright (c) 2013-2014 by thingsym\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsym%2Fjquery.background-fit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthingsym%2Fjquery.background-fit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthingsym%2Fjquery.background-fit/lists"}