{"id":159,"date":"2017-03-25T11:53:09","date_gmt":"2017-03-25T02:53:09","guid":{"rendered":"http:\/\/genicca.wp.xdomain.jp\/?p=159"},"modified":"2025-02-13T13:07:23","modified_gmt":"2025-02-13T04:07:23","slug":"php%e3%82%92%e4%bd%bf%e3%82%8f%e3%81%9a%e3%81%ab%e7%8f%be%e5%9c%a8%e3%81%ae%e3%83%9a%e3%83%bc%e3%82%b8%e3%81%ae%e3%83%8a%e3%83%93%e3%83%9c%e3%82%bf%e3%83%b3%e3%81%ab%e8%89%b2%e3%82%92%e4%bb%98","status":"publish","type":"post","link":"https:\/\/genicca.cloudfree.jp\/?p=159","title":{"rendered":"php\u3092\u4f7f\u308f\u305a\u306b\u73fe\u5728\u306e\u30da\u30fc\u30b8\u306e\u30ca\u30d3\u30dc\u30bf\u30f3\u306b\u8272\u3092\u4ed8\u3051\u308b"},"content":{"rendered":"<p>\u3053\u308c\u306f\u3059\u3054\u304f\u4fbf\u5229\u3002<\/p>\n<p>\u7d76\u5bfe\u30d1\u30b9\u3067\u306e\u6307\u5b9a<\/p>\n<p><strong>CSS<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>#menu a{color: #777}\r\n#menu a.on{color: #000}<\/code><\/pre>\n<\/div>\n<p><strong>html<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;ul id=\"menu\" class=\"cf\"&gt;\r\n&lt;li&gt;&lt;a href=\"http:\/\/abc.com\/index.html\"&gt;home&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"http:\/\/abc.com\/page_sub1.html\"&gt;sub1&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"http:\/\/abc.com\/page_sub2.html\"&gt;sub2&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"http:\/\/abc.com\/page_sub3.html\"&gt;sub3&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"http:\/\/abc.com\/page_sub4.html\"&gt;sub4&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/code><\/pre>\n<\/div>\n<p><strong>JS<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>$(function(){\r\nvar url = $(location).attr('href');\r\n$('#menu').find('a').each(function(){\r\nvar link = $(this).attr('href');\r\nif(link == url){\r\n$(this).addClass('on');\r\n}\r\n});\r\n});<\/code><\/pre>\n<\/div>\n<p><strong>\u76f4\u63a5\u25cb\u25cb.html\u3068\u3057\u3066\u3057\u307e\u3046\u3088\u3046\u306a\u5834\u5408\u306b\u306f\u4e0b\u8a18\u306e\u3088\u3046\u306bJS\u3092\u66f8\u304d\u63db\u3048\u307e\u3059\u3002A\u30bf\u30b0\u306e\u4e2d\u8eab\u3067\u5206\u5c90\u3057\u3066\u4e00\u3064\u306e\u30b3\u30fc\u30c9\u306b\u3057\u3066\u3082\u826f\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/strong><\/p>\n<p><strong>html<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;ul id=\"menu\" class=\"cf\"&gt;\r\n&lt;li&gt;&lt;a href=\"page_index.html\"&gt;home&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"page_sub1.html\"&gt;sub1&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"page_sub2.html\"&gt;sub2&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"page_sub3.html\"&gt;sub3&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;li&gt;&lt;a href=\"page_sub4.html\"&gt;sub4&lt;\/a&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;<\/code><\/pre>\n<\/div>\n<p><strong>JS<\/strong><\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>$(function(){\r\nvar url = $(location).attr('href');\r\nvar url_sp = url.split(\"\/\");\r\nvar file = url_sp[url_sp.length - 1];\r\n$('#menu').find('a').each(function(){\r\nvar link = $(this).attr('href');\r\nif(link == file){\r\n$(this).addClass('on');\r\n}\r\n});\r\n});<\/code><\/pre>\n<\/div>\n<p>\u73fe\u5728\u30a2\u30af\u30bb\u30b9\u4e2d\u306eURL\u3092\u53d6\u5f97\u3057\u3001\u6b21\u306b\/\u6700\u5f8c\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u3057\u307e\u3059\u3002\u3053\u306e\u53d6\u5f97\u3057\u305f\u30c6\u30ad\u30b9\u30c8\u306e\u5185\u5bb9\u306b\u5fdc\u3058\u3066\u30af\u30e9\u30b9\u3092\u3064\u3051\u3066\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u308c\u306f\u3059\u3054\u304f\u4fbf\u5229\u3002 \u7d76\u5bfe\u30d1\u30b9\u3067\u306e\u6307\u5b9a CSS #menu a{color: #777} #menu a.on{color: #000} html &lt;ul id=&#8221;menu&#8221; class=&#8221;cf&#8221;&gt; &lt;l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-html_css","category-js"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=159"}],"version-history":[{"count":3,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/159\/revisions"}],"predecessor-version":[{"id":607,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/159\/revisions\/607"}],"wp:attachment":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}