{"id":856,"date":"2018-04-11T23:33:09","date_gmt":"2018-04-11T14:33:09","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=856"},"modified":"2023-05-27T21:06:12","modified_gmt":"2023-05-27T12:06:12","slug":"%e3%80%90jquery%e3%80%91%e3%82%a4%e3%83%99%e3%83%b3%e3%83%88%e5%87%a6%e7%90%86%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6%e7%90%86%e8%a7%a3%e3%81%99%e3%82%8b%e3%80%82","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=856","title":{"rendered":"\u3010jQuery\u3011\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u306b\u3064\u3044\u3066\u6df1\u304f\u7406\u89e3\u3059\u308b\u3002"},"content":{"rendered":"<p>\u4f8b\u3048\u3070\u3001jQuery\u3067\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u306e\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u3092\u66f8\u304f\u3068\u304d\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8f09\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n$(function() {\r\n $('li a')\r\n .mouseover(function() {\r\n   $(this).attr('src', '..\/images\/open.gif');\r\n })\r\n .mouseout(function() {\r\n    $(this).attr('src', '..\/images\/close.gif');\r\n });\r\n });\r\n<\/pre>\n<p>\u3067\u3059\u304c\u3001\u306a\u305c\u3053\u306e\u3088\u3046\u306a\u5b9a\u578b\u6587\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3001\u4e0d\u601d\u8b70\u306b\u601d\u3046\u90e8\u5206\u306f\u3042\u308a\u307e\u305b\u3093\u304b\u306d\u3002<\/p>\n<h2>$(this)\u306b\u3064\u3044\u3066<\/h2>\n<p>\u300c$(this)\u300d\u306f\u3001\u4f55\u3068\u306a\u304f\u3001\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u81ea\u8eab\u3092\u3055\u3057\u3066\u3044\u308b\u3068\u3044\u3046\u3053\u3068\u3092\u7406\u89e3\u3055\u308c\u3066\u3044\u308b\u65b9\u3082\u591a\u3044\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u3060\u3044\u305f\u3044\u3042\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><span style=\"color: #ff0000;\"><strong>\u6b63\u78ba\u306a\u7406\u89e3\u3068\u3057\u3066\u306f\u3001\u300c$(this)\u300d\u306f\u3001\u300c\u30a4\u30d9\u30f3\u30c8\u304c\u767a\u751f\u3057\u305f\u8981\u7d20\u305d\u306e\u3082\u306e\u3092\u793a\u3059jQuery\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u300d<\/strong><\/span>\u3067\u3059\u3002\u4e0a\u306e\u4f8b\u3067\u8a00\u3048\u3070\u3001\u300cmouseover\u30a4\u30d9\u30f3\u30c8\u300d\u3001\u300cmouseout\u30a4\u30d9\u30f3\u30c8\u300d\u5171\u306b\u3001\u300cli a\u300d\u3068\u3044\u3046\u8981\u7d20\u304c\u300c$(this)\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u95a2\u6570\u306e\u5909\u6570\u4ee3\u5165\u3082\u53ef\u80fd<\/h2>\n<p>\u3053\u308c\u306f\u3001jQuery\u3068\u3044\u3046\u3088\u308a\u306f\u3001JavaScript\u306e\u77e5\u8b58\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u5909\u6570\u306e\u4e2d\u306b\u3001<span style=\"color: #ff0000;\"><strong>\u95a2\u6570\u3092\u4ee3\u5165\u3059\u308b\u3053\u3068\u304c\u53ef\u80fd<\/strong><\/span>\u3067\u3059\u306e\u3067\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306bjQuery\u306e\u8a18\u8ff0\u3068\u306f\u5206\u3051\u3066\u66f8\u304f\u3053\u3068\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\n$(function() {\r\nvar onmouseover = function() {\r\n$(this).attr('src', '..\/images\/open.gif');\r\n};\r\n\r\nvar onmouseout = function() {\r\n$(this).attr('src', '..\/images\/close.gif');\r\n};\r\n\r\n$('li a')\r\n.mouseover(onmouseover)\r\n.mouseout(onmouseout)\r\n});\r\n&lt;\/script&gt;\r\n\r\n<\/pre>\n<h2>click\u30a4\u30d9\u30f3\u30c8\u3068\u3001on\u30a4\u30d9\u30f3\u30c8\u306e\u9055\u3044\u306b\u306f\u8981\u6ce8\u610f\uff01<\/h2>\n<p>\u3044\u305a\u308c\u3082\u3001\u30de\u30a6\u30b9\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u969b\u306e\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u3092\u8a18\u8ff0\u3057\u307e\u3059\u304c\u3001\u305d\u306e\u9055\u3044\u306b\u306f\u6ce8\u610f\u3067\u3059\u3002<\/p>\n<h3>click\u30a4\u30d9\u30f3\u30c8\u306e\u5834\u5408<\/h3>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n$(\u2018#button\u2019).click(\r\n\r\nfunction(){\r\n\r\naleart('\u30c6\u30b9\u30c8');\r\n\r\n});\r\n\r\n<\/pre>\n<h3>on\u30a4\u30d9\u30f3\u30c8<\/h3>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n\r\n$(document).on(\u2018click\u2019,\u2019#button\u2019,function(){\r\nalert(\u2018\u30c6\u30b9\u30c8\u2019);\r\n});\r\n\r\n<\/pre>\n<p>\u4e0a\u8a18\u5168\u304f\u540c\u3058\u3088\u3046\u306b\u898b\u3048\u307e\u3059\u304c\u3001<strong>\u5c11\u3057\u9055\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p>click\u30a4\u30d9\u30f3\u30c8\u306f\u3001<strong>\u300c\u30da\u30fc\u30b8\u30ed\u30fc\u30c9\u6642\u306b\u8aad\u307f\u8fbc\u307e\u308c\u305f\u8981\u7d20\u306e\u307f\u306b\u6709\u52b9\u300d<\/strong>\u3067\u3001on\u30a4\u30d9\u30f3\u30c8\u306f\u3001<strong>\u300c\u30da\u30fc\u30b8\u30ed\u30fc\u30c9\u5f8c\u3082\u3001\u52d5\u7684\u306b\u751f\u6210\u3055\u308c\u305f\u8981\u7d20\u306b\u3082\u6709\u52b9\u300d<\/strong>\u306a\u306e\u3067\u3059\u3002\u306a\u306e\u3067\u3001\u5b89\u6613\u306b\u30af\u30ea\u30c3\u30af\u3055\u308c\u305f\u5f8c\u306b\u52d5\u4f5c\u3059\u308b\u30a4\u30d9\u30f3\u30c8\u3060\u304b\u3089\u3068\u3044\u3063\u3066\u3001click\u30a4\u30d9\u30f3\u30c8\u3092\u9078\u3093\u3067\u3057\u307e\u3046\u3068\u52d5\u304b\u306a\u3044\u3068\u3044\u3046\u3053\u3068\u306b\u306a\u308b\u306e\u3067\u3001\u8981\u6ce8\u610f\u3067\u3059\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"\u4f8b\u3048\u3070\u3001jQuery\u3067\u30de\u30a6\u30b9\u30aa\u30fc\u30d0\u30fc\u306e\u30a4\u30d9\u30f3\u30c8\u51e6\u7406\u3092\u66f8\u304f\u3068\u304d\u306f\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u8a18\u8f09\u3059\u308b\u3068\u601d\u3044\u307e\u3059\u3002 \u3067\u3059\u304c\u3001\u306a\u305c\u3053\u306e\u3088\u3046\u306a\u5b9a\u578b\u6587\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u3001\u4e0d\u601d\u8b70\u306b\u601d\u3046\u90e8\u5206\u306f\u3042\u308a\u307e\u305b\u3093\u304b\u306d\u3002 $(this)\u306b\u3064\u3044\u3066 \u300c$(this)\u300d [&hellip;]","protected":false},"author":1,"featured_media":865,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/856"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=856"}],"version-history":[{"count":10,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/856\/revisions"}],"predecessor-version":[{"id":20316,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/856\/revisions\/20316"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/media\/865"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=856"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=856"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=856"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}