{"id":320,"date":"2019-08-14T10:16:56","date_gmt":"2019-08-14T01:16:56","guid":{"rendered":"http:\/\/genicca.wp.xdomain.jp\/?p=320"},"modified":"2025-02-13T11:01:48","modified_gmt":"2025-02-13T02:01:48","slug":"%e4%b8%8b%e9%83%a8%e5%9b%ba%e5%ae%9a%e3%81%97%e3%81%a6%e3%82%8b%e8%a6%81%e7%b4%a0%e3%81%8c%e3%83%95%e3%83%83%e3%82%bf%e3%83%bc%e3%81%be%e3%81%a7%e6%9d%a5%e3%81%9f%e3%82%89%e3%83%95%e3%83%83%e3%82%bf","status":"publish","type":"post","link":"https:\/\/genicca.cloudfree.jp\/?p=320","title":{"rendered":"\u4e0b\u90e8\u56fa\u5b9a\u3057\u3066\u308b\u8981\u7d20\u304c\u30d5\u30c3\u30bf\u30fc\u307e\u3067\u6765\u305f\u3089\u30d5\u30c3\u30bf\u30fc\u306e\u4e0a\u3067\u6b62\u3081\u308bJS"},"content":{"rendered":"<p>\u30b9\u30de\u30db\u30b5\u30a4\u30c8\u3068\u304b\u3067\u6d41\u884c\u308a\u306e\u30d5\u30c3\u30bf\u30fc\u56fa\u5b9a\u30d0\u30ca\u30fc\u7684\u306a\u3084\u3064\u304c\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066\u308b\u3046\u3061\u306b\u30d5\u30c3\u30bf\u30fc\u306b\u3076\u3061\u5f53\u305f\u3063\u305f\u3068\u304d\u306e\u51e6\u7406\u3002<br \/>\ndisplay:flex;\u72b6\u614b\u3060\u3068\u30d5\u30c3\u30bf\u30fc\u306e\u4e0a\u306b\u88ab\u3063\u3061\u3083\u3046\u306e\u3067\u3001\u88ab\u3089\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n<p>\u307e\u305aHTML\u3002\u3061\u306a\u307f\u306b\u30bd\u30fc\u30b9\u306e\u4e2d\u306e\u300cheight\u300d\u306f\u9069\u5b9c\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3042\u3068\u3001\u30d5\u30c3\u30bf\u30fc\u306e\u4e0a\u3067\u56fa\u5b9a\u3055\u305b\u305f\u3044\u8981\u7d20\u306f\u3001\u56fa\u5b9a\u3055\u305b\u305f\u3044\u5834\u6240\u306b\u66f8\u3044\u3066\u304f\u3060\u3055\u3044\u3002\uff08position\u6307\u5b9a\u7121\u3057\u72b6\u614b\u3067\u306e\u5358\u7d14\u306a\u4f4d\u7f6e\uff09<br \/>\n\u2193\u3060\u3068\u3061\u3083\u3093\u3068footer\u306e\u4e0a\u306b\u66f8\u3044\u3066\u3001position\u3068\u304b\u6307\u5b9a\u3057\u306a\u3044\u5834\u5408\u3061\u3083\u3093\u3068footer\u306e\u4e0a\u306b\u3074\u3061\u3063\u3068\u51fa\u308b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3068\u3001header\u3068\u304bcontent\u3068\u304b\u306e\u69cb\u6210\u306f\u9069\u5f53\u3067\u3059\u3002\u4f55\u304c\u5927\u4e8b\u304b\u3063\u3066\u3001\u56fa\u5b9a\u3057\u305f\u3044\u8981\u7d20\u306e#sticky_footer\u306e\u5668\u3092\u3057\u3063\u304b\u308a\u4f5c\u308b\u306e\u304c\u5927\u4e8b\u306a\u306e\u3067\u3059\u3002<br \/>\n\u4f55\u6545\u306a\u306e\u304b\u306f\u5f8c\u8ff0\u3057\u307e\u3059\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-html\" data-lang=\"HTML\"><code>&lt;header&gt;\r\n\u30d8\u30c3\u30c0\uff5e\r\n&lt;\/header&gt;\r\n\r\n&lt;div id=\"content\"&gt;\r\n\u3053\u3093\u3066\u3093\u3064\uff01\r\n&lt;\/div&gt;\r\n\r\n&lt;div style=\"height:50px;width:100%;\"&gt;\r\n&lt;footer id=\"sticky_footer\"&gt;\r\n\r\n#sticky_footer\u3092\u56fa\u5b9a\u3057\u305f\u3044\uff01\r\n\r\n&lt;\/footer&gt;\r\n&lt;\/div&gt;\r\n\r\n&lt;footer id=\"main_footer\"&gt;\r\n\u30d5\u30c3\u30bf\uff5e\r\n&lt;\/footer&gt;<\/code><\/pre>\n<\/div>\n<p>CSS\u3067\u3059\u3002\u3053\u3053\u3067\u3069\u3046\u3044\u3046\u8981\u7d20\u304b\u5b9a\u7fa9\u3057\u3066\u304a\u304d\u307e\u3059\u3002\u4e3b\u306b\u88c5\u98fe\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-css\" data-lang=\"CSS\"><code>footer.sticky_footer{\r\nbackground-color: #ff00ff;\r\nheight:50px;\r\nwidth: 100%;\r\ncolor:#fff;\r\ntext-align: center;\r\nline-height: 50px;\r\n}<\/code><\/pre>\n<\/div>\n<p>JS\u3067\u3059\u3002\u30af\u30e9\u30b9\u540d\u3068\u304b\u306f\u9069\u5b9c\u5909\u3048\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism line-numbers lang-js\" data-lang=\"JavaScript\"><code>jQuery(window).on(\"scroll\", function() {\r\ndocumentHeight = jQuery(document).height();\r\nscrollPosition = jQuery(this).height() + jQuery(this).scrollTop();\r\nfooterHeight = jQuery(\"#site_footer\").outerHeight();\r\n\r\nif (documentHeight - scrollPosition &lt;= footerHeight) {\r\njQuery(\"#sticky_footer\").css({\r\nposition: \"static\",\r\nbottom: \"auto\"\r\n});\r\n} else {\r\njQuery(\"#sticky_footer\").css({\r\nposition: \"fixed\",\r\nbottom: 0\r\n});\r\n}\r\n});<\/code><\/pre>\n<\/div>\n<p>\u3053\u3093\u306a\u611f\u3058\u3067\u3059\u3002<\/p>\n<p>\u3042\u3068\u4e0a\u3067\u8a00\u3063\u3066\u305f\u3053\u3068\u3067\u3059\u304c\u3001\u3061\u3083\u3093\u3068\u56fa\u5b9a\u3057\u305f\u3044\u8981\u7d20\u3068\u540c\u3058\u9ad8\u3055\u306e\u5668\u3092\u4f5c\u3063\u3066\u304a\u304b\u306a\u3044\u3068\u3001\u3044\u3056\u8981\u7d20\u304c\u56fa\u5b9a\u3055\u308c\u305f\u6642\u306b\u65b0\u8981\u7d20\u304c\u5165\u3063\u3066\u304d\u305f\uff01\u3068\u306a\u3063\u3066\u30b5\u30a4\u30c8\u306e\u9ad8\u3055\u304c\u5909\u308f\u3063\u3066\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u30b0\u30cb\u30e5\u3063\u3068\u52d5\u3044\u3066\u30d5\u30c3\u30bf\u30fc\u304c\u30ac\u30af\u30c3\u3068\u843d\u3061\u305f\u611f\u3058\u306b\u306a\u3063\u3061\u3083\u3044\u307e\u3059\u306d\u3002\u305d\u3046\u3044\u3046\u305f\u3081\u306e\u5bfe\u7b56\u3067\u3059\u3002<br \/>\n\u3053\u308c\u306f\u3042\u307e\u308a\u4ed6\u306e\u30b5\u30a4\u30c8\u3082\u66f8\u3044\u3066\u306a\u304f\u3066\u56f0\u308a\u307e\u3057\u305f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u30b9\u30de\u30db\u30b5\u30a4\u30c8\u3068\u304b\u3067\u6d41\u884c\u308a\u306e\u30d5\u30c3\u30bf\u30fc\u56fa\u5b9a\u30d0\u30ca\u30fc\u7684\u306a\u3084\u3064\u304c\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u3066\u308b\u3046\u3061\u306b\u30d5\u30c3\u30bf\u30fc\u306b\u3076\u3061\u5f53\u305f\u3063\u305f\u3068\u304d\u306e\u51e6\u7406\u3002 display:flex;\u72b6\u614b\u3060\u3068\u30d5\u30c3\u30bf\u30fc\u306e\u4e0a\u306b\u88ab\u3063\u3061\u3083\u3046\u306e\u3067\u3001\u88ab\u3089\u306a\u3044\u3088\u3046\u306b\u3057\u307e\u3059\u3002 \u307e\u305aHTML\u3002\u3061\u306a\u307f [&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":[4],"tags":[],"class_list":["post-320","post","type-post","status-publish","format-standard","hentry","category-js"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/320","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=320"}],"version-history":[{"count":3,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/320\/revisions"}],"predecessor-version":[{"id":544,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=\/wp\/v2\/posts\/320\/revisions\/544"}],"wp:attachment":[{"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/genicca.cloudfree.jp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}