{"id":1435,"date":"2012-01-14T15:11:20","date_gmt":"2012-01-14T06:11:20","guid":{"rendered":"http:\/\/codaholic.org\/?p=1435"},"modified":"2020-08-23T17:16:00","modified_gmt":"2020-08-23T08:16:00","slug":"jquery%e7%94%bb%e5%83%8f%e3%81%ae%e8%a1%a8%e7%a4%ba%e3%82%b5%e3%82%a4%e3%82%ba%e3%81%ab%e4%b8%8a%e9%99%90%e3%82%84%e4%b8%8b%e9%99%90%e3%82%92%e8%a8%ad%e5%ae%9a%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/codaholic.org\/?p=1435","title":{"rendered":"[jQuery] \u753b\u50cf\u306e\u8868\u793a\u30b5\u30a4\u30ba\u306b\u4e0a\u9650\u3084\u4e0b\u9650\u3092\u8a2d\u5b9a\u3059\u308b"},"content":{"rendered":"<p>img \u8981\u7d20\u306b width \u3084 height \u3092\u6307\u5b9a\u3059\u308b\u3068\u753b\u50cf\u306e\u8868\u793a\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3067\u3059\u304c width \u3084 height \u306b\u4e0a\u9650\u3084\u4e0b\u9650\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f XHTML \u3084 CSS \u3060\u3051\u3067\u306f\u5b9f\u73fe\u3067\u304d\u307e\u305b\u3093\u3002\u3053\u306e\u6a5f\u80fd\u3092jQuery \u3092\u4f7f\u3063\u3066\u5b9f\u73fe\u3057\u307e\u3059\u3002<\/p>\n<p><!--more--><\/p>\n<p>\u4f8b\u3048\u3070\u4e0b\u8a18\u306e\u30b3\u30fc\u30c9\u306f target_image \u3068\u3044\u3046\u30af\u30e9\u30b9\u304c\u4ed8\u3051\u3089\u308c\u305f\u753b\u50cf\u306e\u6a2a\u5e45\u304c 100px \u4ee5\u4e0a\u306b\u306a\u3063\u305f\u5834\u5408\u306b\u5f37\u5236\u7684\u306b 100px \u306b\u7e2e\u3081\u307e\u3059\u3002\u3064\u307e\u308a\u8868\u793a\u3055\u308c\u308b\u753b\u50cf\u30b5\u30a4\u30ba\u306b\u4e0a\u9650\u3092\u8a2d\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><code class=\"language-javascript\">$(function(){\n    var w = $('.target_image').css('width').replace(\/px\/, '');\n    if(w &gt; 100){\n        $('.target_image').css('width', 100);\n    }\n});\n<\/code><\/pre>\n<p>\u9006\u306b\u4e0b\u9650\u3092\u8a2d\u3051\u308b\u5834\u5408\u306f <code>w &gt; 100<\/code> \u3068\u6bd4\u8f03\u3057\u3066\u3044\u308b\u3068\u3053\u308d\u3092 <code>w &lt; 100<\/code> \u3068\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>img \u8981\u7d20\u306b width \u3084 height \u3092\u6307\u5b9a\u3059\u308b\u3068\u753b\u50cf\u306e\u8868\u793a\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u3067\u3059\u304c width \u3084 height \u306b\u4e0a\u9650\u3084\u4e0b\u9650\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f XHTML \u3084 CSS \u3060\u3051\u3067\u306f\u5b9f\u73fe\u3067\u304d\u307e\u305b\u3093\u3002\u3053 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[5,6],"tags":[245,246],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p8gd1W-n9","_links":{"self":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1435"}],"collection":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1435"}],"version-history":[{"count":7,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions"}],"predecessor-version":[{"id":2432,"href":"https:\/\/codaholic.org\/index.php?rest_route=\/wp\/v2\/posts\/1435\/revisions\/2432"}],"wp:attachment":[{"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1435"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1435"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codaholic.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1435"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}