{"id":13660002,"url":"https://github.com/bramstein/jsizes","last_synced_at":"2025-03-25T05:32:20.653Z","repository":{"id":964944,"uuid":"756358","full_name":"bramstein/jsizes","owner":"bramstein","description":"jQuery CSS size properties plugin","archived":false,"fork":false,"pushed_at":"2018-06-21T17:37:41.000Z","size":132,"stargazers_count":36,"open_issues_count":2,"forks_count":27,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-16T20:16:51.601Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://www.bramstein.com/projects/jsizes/","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/bramstein.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":"2010-07-04T14:38:53.000Z","updated_at":"2025-01-08T19:05:24.000Z","dependencies_parsed_at":"2022-07-20T06:32:23.198Z","dependency_job_id":null,"html_url":"https://github.com/bramstein/jsizes","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramstein%2Fjsizes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramstein%2Fjsizes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramstein%2Fjsizes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bramstein%2Fjsizes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bramstein","download_url":"https://codeload.github.com/bramstein/jsizes/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407667,"owners_count":20610231,"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":[],"created_at":"2024-08-02T05:01:14.791Z","updated_at":"2025-03-25T05:32:20.419Z","avatar_url":"https://github.com/bramstein.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"## JSizes ― jQuery extension plugin for CSS properties\n\nJSizes is a small plugin for the [jQuery JavaScript library](http://jquery.com/) which adds convenience methods for querying and setting the CSS `min-width`, `min-height`, `max-width`, `max-height`, `border-*-width`, `margin`, and `padding` properties. Additionally it has one method for determining whether an element is visible. In total it adds six new methods to the jQuery element API. It internally calls the jQuery built-in `css` method, so syntax and use is identical to calling `css('property-name', ...)`. An example of its use follows.\n\n    jQuery(function($) {\n       var myDiv = $('#myDiv');\n    \n       myDiv.minWidth(100); // set 'min-width' to 100px\n       alert(myDiv.minWidth()); // displays '100'\n    });\n\nNote that all returned values are converted to pixel values, without the `px` suffix. It is thus safe to use these methods in calculations without having to worry about non-numeric values. Most importantly, it does *not* add support for min- and max-sizes on browsers that do not natively support it, it just adds convenient methods to query these properties and return a sensible value when they are not available or not set.\n\n## API\n\nThe plugin adds the following methods to the JQuery object:\n\n\u003cdl\u003e\n    \u003cdt\u003eminSize()\u003c/dt\u003e\n    \u003cdd\u003eReturns the CSS `min-width` and `min-height` properties of the first matched element as pixel values in an object with `width` and `height` properties. If a CSS property is not set `0` is returned as value.\n\u003c/dd\u003e\n    \u003cdt\u003eminSize(value)\u003c/dt\u003e\n    \u003cdd\u003eSets the CSS `min-width`, and `min-height` property on all matched elements. Expects a value object containing any of `width` and `height` properties. If the property values are numbers they will be converted to pixel values.\u003c/dd\u003e\n    \n    \u003cdt\u003emaxSize()\u003c/dt\u003e\n    \u003cdd\u003eReturns the CSS `max-width` and `max-height` properties of the first matched element as pixel values in an object with `width` and `height` properties. If a CSS property is not set `Number.MAX_VALUE` is returned as value.\u003c/dd\u003e\n    \n    \u003cdt\u003emaxSize(value)\u003c/dt\u003e\n    \u003cdd\u003eSets the CSS `max-width` and `max-height` property on all matched elements. Expects a value object containing any of `width` and `height` properties. If the property values are numbers they will be converted to pixel values.\u003c/dd\u003e\n    \n    \u003cdt\u003emargin()\u003c/dt\u003e\n    \u003cdd\u003eReturns the CSS `margin` property of the first matched element as pixel values in an object with `top`, `bottom`, `left`, and `right` properties.\u003c/dd\u003e\n    \n    \u003cdt\u003emargin(value)\u003c/dt\u003e\n    \u003cdd\u003eSets the CSS `margin` property on all matched elements. Expects a value object containing any of `top` , `bottom` , `left` , and `right` properties. If the property values are numbers they will be converted to pixel values.\u003c/dd\u003e\n    \n    \u003cdt\u003epadding()\u003c/dt\u003e\n    \u003cdd\u003eReturns the CSS `padding` property of the first matched element as pixel values in an object with `top`, `bottom`, `left`, and `right` properties.\u003c/dd\u003e\n    \n    \u003cdt\u003epadding(value)\u003c/dt\u003e\n    \u003cdd\u003eSets the CSS `padding` property on all matched elements. Expects a value object containing any of `top`, `bottom`, `left`, and `right` properties. If the property values are numbers they will be converted to pixel values.\u003c/dd\u003e\n    \n    \u003cdt\u003eborder()\u003c/dt\u003e\n    \u003cdd\u003eReturns the CSS `border-*-width` property of the first matched element as pixels values in an object with `top`, `bottom`, `left`, and `right` properties.\u003c/dd\u003e\n    \n    \u003cdt\u003eborder(value)\u003c/dt\u003e\n    \u003cdd\u003eSets the CSS `border-*-width` property on all matched elements. Expects a value object containing any of `top`, `bottom`, `left`, and `right` properties. If the property values are numbers they will be converted to pixel values. Note that the CSS `border-style` property also needs to be set in order for the border to show.\u003c/dd\u003e\n    \n    \u003cdt\u003eisVisible()\u003c/dt\u003e\n    \u003cdd\u003eReturns true if the any of the matched element are visible, false otherwise.\u003c/dd\u003e\n\u003c/dl\u003e\n\n## Examples\n\nSome examples of how the new methods can be used:\n\n    jQuery(function($) {\n       var myDiv = $('#myDiv');\n    \n       // set margin-top to 100px and margin-bottom to 10em\n       myDiv.margin({top: 100, bottom: '10em'});\n    \n       // displays the size of the top border in pixels\n       alert(myDiv.border().top);\n    \n       // displays true if the element is visible, false otherwise\n       alert(myDiv.isVisible());\n    \n       // set padding-right to 10px and margin-left to 15px using chaining\n       myDiv.padding({right: 10}).margin({left: 15});\n    });\n\nThe above example also shows that chaining can be used on methods that do not return values.\n\n## Credits\n\n* John Bowers ― Setting values to zero bug fix.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramstein%2Fjsizes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbramstein%2Fjsizes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbramstein%2Fjsizes/lists"}