{"id":283,"date":"2018-06-08T13:36:31","date_gmt":"2018-06-08T04:36:31","guid":{"rendered":"http:\/\/genicca.wp.xdomain.jp\/?p=283"},"modified":"2025-02-13T11:24:03","modified_gmt":"2025-02-13T02:24:03","slug":"%e6%96%87%e5%ad%97%e3%82%b5%e3%82%a4%e3%82%ba%e5%a4%89%e6%9b%b4%e3%83%9c%e3%82%bf%e3%83%b3","status":"publish","type":"post","link":"https:\/\/genicca.cloudfree.jp\/?p=283","title":{"rendered":"\u6587\u5b57\u30b5\u30a4\u30ba\u5909\u66f4\u30dc\u30bf\u30f3"},"content":{"rendered":"<p>\u7d50\u69cb\u533b\u7642\u7cfb\u306e\u30b5\u30a4\u30c8\u3060\u3068\u6587\u5b57\u30b5\u30a4\u30ba\u306e\u5909\u66f4\u30dc\u30bf\u30f3\u304c\u5fc5\u8981\u3060\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u305d\u308c\u306e\u5099\u5fd8\u9332\u3002<\/p>\n<p>JS<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>&lt;script type=\"text\/javascript\" src=\"http:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/1.6.4\/jquery.min.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"common\/js\/jquery.cookie.js\"&gt;&lt;\/script&gt;\r\n&lt;script src=\"common\/js\/fontsize.js\"&gt;&lt;\/script&gt;<\/code><\/pre>\n<\/div>\n<p>fontsize.js<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>jQuery(function($){\r\n\/\/\u5909\u6570\u306b\u30af\u30c3\u30ad\u30fc\u540d\u3092\u5165\u308c\u308b\r\nvar history = $.cookie('fontSize');\r\n\/\/\u9069\u7528\u3059\u308b\u7b87\u6240\u3092\u6307\u5b9a\u3002\u4eca\u56de\u306f\u90e8\u5206\u7684\u306b#test\u5185\u306ep\u306b\r\nvar elm = $('body');\r\n\/\/\u5909\u6570\u304c\u7a7a\u306a\u3089fontM\u3092\u3001\u7a7a\u3067\u306a\u3051\u308c\u3070\u30af\u30c3\u30ad\u30fc\u306b\u4fdd\u5b58\u3057\u3066\u304a\u3044\u305f\u3082\u306e\u3092\u9069\u7528\r\nif(!history){\r\nelm.addClass('fontS');\r\n$('#fontS').addClass('active');\r\n}else{\r\nelm.addClass(history);\r\n$('#'+history).addClass('active');\r\n}\r\n\/\/\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3057\u305f\u3089\u5b9f\u884c\r\n$('li','.mod_headerbox_size').click(function(){\r\n\/\/active\u3067\u306a\u3044\u30dc\u30bf\u30f3\u3060\u3063\u305f\u5834\u5408\u306e\u307f\u52d5\u4f5c\r\nif(!$(this).hasClass('active')){\r\n\/\/\u73fe\u5728active\u306e\u3064\u3044\u3066\u3044\u308bclass\u3092\u524a\u9664\r\n$('.active').removeClass('active');\r\n\/\/\u30af\u30ea\u30c3\u30af\u3057\u305f\u30dc\u30bf\u30f3\u3092active\r\n$(this).addClass('active');\r\n\/\/\u30af\u30ea\u30c3\u30af\u3057\u305f\u8981\u7d20\u306eID\u540d\u3092\u5909\u6570\u306b\u30bb\u30c3\u30c8\r\nvar setFontSize = this.id;\r\n\/\/\u30af\u30c3\u30ad\u30fc\u306b\u5909\u6570\u3092\u4fdd\u5b58\r\n$.cookie('fontSize', setFontSize);\r\n\/\/\u4e00\u5ea6class\u3092\u9664\u53bb\u3057\u3066\u3001\u5909\u6570\u3092class\u3068\u3057\u3066\u8ffd\u52a0\r\nelm.removeClass().addClass(setFontSize);\r\n}\r\n});\r\n});<\/code><\/pre>\n<\/div>\n<p>jquery.cookie.js<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>\/**\r\n* Cookie plugin\r\n*\r\n* Copyright (c) 2006 Klaus Hartl (stilbuero.de)\r\n* Dual licensed under the MIT and GPL licenses:\r\n* http:\/\/www.opensource.org\/licenses\/mit-license.php\r\n* http:\/\/www.gnu.org\/licenses\/gpl.html\r\n*\r\n*\/\r\n\r\n\/**\r\n* Create a cookie with the given name and value and other optional parameters.\r\n*\r\n* @example $.cookie('the_cookie', 'the_value');\r\n* @desc Set the value of a cookie.\r\n* @example $.cookie('the_cookie', 'the_value', { expires: 7, path: '\/', domain: 'jquery.com', secure: true });\r\n* @desc Create a cookie with all available options.\r\n* @example $.cookie('the_cookie', 'the_value');\r\n* @desc Create a session cookie.\r\n* @example $.cookie('the_cookie', null);\r\n* @desc Delete a cookie by passing null as value. Keep in mind that you have to use the same path and domain\r\n* used when the cookie was set.\r\n*\r\n* @param String name The name of the cookie.\r\n* @param String value The value of the cookie.\r\n* @param Object options An object literal containing key\/value pairs to provide optional cookie attributes.\r\n* @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.\r\n* If a negative value is specified (e.g. a date in the past), the cookie will be deleted.\r\n* If set to null or omitted, the cookie will be a session cookie and will not be retained\r\n* when the the browser exits.\r\n* @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).\r\n* @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).\r\n* @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will\r\n* require a secure protocol (like HTTPS).\r\n* @type undefined\r\n*\r\n* @name $.cookie\r\n* @cat Plugins\/Cookie\r\n* @author Klaus Hartl\/klaus.hartl@stilbuero.de\r\n*\/\r\n\r\n\/**\r\n* Get the value of a cookie with the given name.\r\n*\r\n* @example $.cookie('the_cookie');\r\n* @desc Get the value of a cookie.\r\n*\r\n* @param String name The name of the cookie.\r\n* @return The value of the cookie.\r\n* @type String\r\n*\r\n* @name $.cookie\r\n* @cat Plugins\/Cookie\r\n* @author Klaus Hartl\/klaus.hartl@stilbuero.de\r\n*\/\r\njQuery.cookie = function(name, value, options) {\r\nif (typeof value != 'undefined') { \/\/ name and value given, set cookie\r\noptions = options || {};\r\nif (value === null) {\r\nvalue = '';\r\noptions.expires = -1;\r\n}\r\nvar expires = '';\r\nif (options.expires &amp;&amp; (typeof options.expires == 'number' || options.expires.toUTCString)) {\r\nvar date;\r\nif (typeof options.expires == 'number') {\r\ndate = new Date();\r\ndate.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));\r\n} else {\r\ndate = options.expires;\r\n}\r\nexpires = '; expires=' + date.toUTCString(); \/\/ use expires attribute, max-age is not supported by IE\r\n}\r\n\/\/ CAUTION: Needed to parenthesize options.path and options.domain\r\n\/\/ in the following expressions, otherwise they evaluate to undefined\r\n\/\/ in the packed version for some reason...\r\nvar path = options.path ? '; path=' + (options.path) : '';\r\nvar domain = options.domain ? '; domain=' + (options.domain) : '';\r\nvar secure = options.secure ? '; secure' : '';\r\ndocument.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');\r\n} else { \/\/ only name given, get cookie\r\nvar cookieValue = null;\r\nif (document.cookie &amp;&amp; document.cookie != '') {\r\nvar cookies = document.cookie.split(';');\r\nfor (var i = 0; i &lt; cookies.length; i++) {\r\nvar cookie = jQuery.trim(cookies[i]);\r\n\/\/ Does this cookie string begin with the name we want?\r\nif (cookie.substring(0, name.length + 1) == (name + '=')) {\r\ncookieValue = decodeURIComponent(cookie.substring(name.length + 1));\r\nbreak;\r\n}\r\n}\r\n}\r\nreturn cookieValue;\r\n}\r\n};<\/code><\/pre>\n<\/div>\n<p>HTML<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;div class=\"mod_headerbox_size\"&gt;\r\n&lt;ul&gt;\r\n&lt;li id=\"fontS\"&gt;&lt;span&gt;&lt;img width=\"30\" height=\"60\" alt=\"\u5c0f\u3055\u3044\u30b5\u30a4\u30ba\" src=\"common\/img\/size_s.jpg\"&gt;&lt;\/span&gt;&lt;\/li&gt;\r\n&lt;li id=\"fontM\"&gt;&lt;span&gt;&lt;img width=\"30\" height=\"60\" alt=\"\u5c11\u3057\u5927\u304d\u3044\u30b5\u30a4\u30ba\" src=\"common\/img\/size_m.jpg\"&gt;&lt;\/span&gt;&lt;\/li&gt;\r\n&lt;li id=\"fontL\"&gt;&lt;span&gt;&lt;img width=\"30\" height=\"60\" alt=\"\u5927\u304d\u3044\u30b5\u30a4\u30ba\" src=\"common\/img\/size_b.jpg\"&gt;&lt;\/span&gt;&lt;\/li&gt;\r\n&lt;\/ul&gt;\r\n&lt;!--mod_headerbox_size_end--&gt;&lt;\/div&gt;<\/code><\/pre>\n<\/div>\n<p>CSS<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>\/* fontsize\r\n-----------------------------------------*\/\r\n.fontS { font-size: 75% }\r\n.fontM { font-size: 85% }\r\n.fontL { font-size: 95% }\r\n\r\n\/* mod_headerbox_size\r\n-----------------------------------------*\/\r\n.mod_headerbox_size {\r\nwidth: 90px;\r\nposition:relative;\r\noverflow:hidden;\r\n}\r\n.mod_headerbox_size ul {\r\n}\r\n.mod_headerbox_size ul li {\r\nfloat: left;\r\nwidth:30px;\r\nheight: 30px;\r\noverflow: hidden;\r\n}\r\n.mod_headerbox_size ul li span {\r\ndisplay: block;\r\ncursor: pointer;\r\n}\r\n.mod_headerbox_size ul li.active span {\r\nmargin-top: -30px;\r\n}\r\n.mod_headerbox_size ul li span:hover{\r\nmargin-top:-30px;\r\n}<\/code><\/pre>\n<\/div>\n<p>\u753b\u50cf\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/genicca.wp.xdomain.jp\/wp-content\/uploads\/2018\/06\/size_b.jpg\" alt=\"\" width=\"30\" height=\"60\" class=\"alignnone size-full wp-image-286\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/genicca.wp.xdomain.jp\/wp-content\/uploads\/2018\/06\/size_m.jpg\" alt=\"\" width=\"30\" height=\"60\" class=\"alignnone size-full wp-image-285\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/genicca.wp.xdomain.jp\/wp-content\/uploads\/2018\/06\/size_s.jpg\" alt=\"\" width=\"30\" height=\"60\" class=\"alignnone size-full wp-image-284\" \/><\/p>\n<p>\u3053\u308c\u3067\u3067\u304d\u308b\u3088<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7d50\u69cb\u533b\u7642\u7cfb\u306e\u30b5\u30a4\u30c8\u3060\u3068\u6587\u5b57\u30b5\u30a4\u30ba\u306e\u5909\u66f4\u30dc\u30bf\u30f3\u304c\u5fc5\u8981\u3060\u3063\u305f\u308a\u3059\u308b\u306e\u3067\u305d\u308c\u306e\u5099\u5fd8\u9332\u3002 JS &lt;script type=&#8221;text\/javascript&#8221; src=&#8221;http:\/\/ajax.googleapis.com\/ [&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-283","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\/283","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=283"}],"version-history":[{"count":5,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions"}],"predecessor-version":[{"id":559,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/283\/revisions\/559"}],"wp:attachment":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}