{"id":147,"date":"2022-02-16T11:23:01","date_gmt":"2022-02-16T02:23:01","guid":{"rendered":"http:\/\/gaku-on.com\/?p=147"},"modified":"2022-02-16T15:14:32","modified_gmt":"2022-02-16T06:14:32","slug":"%e3%81%b5%e3%82%8f%e3%81%a3%e3%81%a8%e3%81%8f%e3%82%8b%e3%80%80%e8%a4%87%e6%95%b0%e7%94%bb%e5%83%8f%e3%80%80%e5%bf%9c%e7%94%a8","status":"publish","type":"post","link":"http:\/\/gaku-on.com\/?p=147","title":{"rendered":"\u3075\u308f\u3063\u3068\u304f\u308b\u3000\u8907\u6570\u753b\u50cf\u3000\u5fdc\u7528"},"content":{"rendered":"\n<figure class=\"wp-block-embed\"><div class=\"wp-block-embed__wrapper\">\nhttps:\/\/moshashugyo.com\/media\/animate-on-scroll\n<\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>HTML\n\n&lt;section class=\"multiple\"&gt;\n    &lt;h2&gt;DEMO2&lt;\/h2&gt;\n\n    &lt;div class=\"multiple-list js-scroll-trigger\"&gt;\n        &lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n&lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n&lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n&lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n&lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n&lt;div class=\"multiple-item u-fade-type-up\"&gt;\n            &lt;img src=\"&#91;myphp file='soutai']\/img\/cat1.jpg\" alt=\"\"&gt;\n        &lt;\/div&gt;\n       \n    &lt;\/div&gt;\n&lt;\/section&gt;\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>CSS\n\n\/* \u30ec\u30a4\u30a2\u30a6\u30c8\u3084\u898b\u305f\u76ee\u306e\u30b9\u30bf\u30a4\u30eb *\/\n\/* ---------------------------- *\/\n\n.multiple-list{\n    display: flex;\n    justify-content: space-between;\n    flex-wrap: wrap;\n}\n\n.multiple-item{\n    width: 49%;\n    margin-top: 20px;\n}\n\n.multiple-item:nth-child(-n+2){\n    margin-top: 0;\n}\n\n\/* \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u30b9\u30bf\u30a4\u30eb *\/\n\/* ---------------------------- *\/\n\n\/* \u30a2\u30cb\u30e1\u30fc\u30b7\u30e7\u30f3\u524d *\/\n.u-fade-type-up{\n    transform: translateY(50px);\n    opacity: 0;\n}\n\n\/* \u30c8\u30ea\u30ac\u30fc\u767a\u706b\u3067is-active\u3092\u4ed8\u4e0e *\/\n.is-active .u-fade-type-up{\n    transition: .6s;\n    transform: translateY(0);\n    opacity: 1;\n}\n\n.is-active .u-fade-type-up:nth-child(2){transition-delay: .4s;}\n.is-active .u-fade-type-up:nth-child(3){transition-delay: .8s;}\n.is-active .u-fade-type-up:nth-child(4){transition-delay: 1.2s;}\n.is-active .u-fade-type-up:nth-child(5){transition-delay: 1.6s;}\n.is-active .u-fade-type-up:nth-child(6){transition-delay: 2s;}\n\n@media screen and (min-width: 768px) {\n    .multiple-item{\n        width: 32%;\n    }\n\n    .multiple-item:nth-child(-n+3){\n        margin-top: 0;\n    }\n}<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>head\u5185\u306b\u66f8\u3044\u3066\u304a\u304f\n\n&lt;script src=\"https:\/\/ajax.googleapis.com\/ajax\/libs\/jquery\/3.3.1\/jquery.min.js\"&gt;&lt;\/script&gt;\n &lt;script&gt;\n\t $(function () {\n    \/\/ aimation\u547c\u3073\u51fa\u3057\n    if ($('.js-scroll-trigger').length) {\n        scrollAnimation();\n    }\n\n    \/\/ aimation\u95a2\u6570\n    function scrollAnimation() {\n        $(window).scroll(function () {\n            $(\".js-scroll-trigger\").each(function () {\n                let position = $(this).offset().top,\n                    scroll = $(window).scrollTop(),\n                    windowHeight = $(window).height();\n\n                if (scroll &gt; position - windowHeight + 200) {\n                    $(this).addClass('is-active');\n                }\n            });\n        });\n    }\n    $(window).trigger('scroll');\n});\n\t &lt;\/script&gt;<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!-- wp:paragraph -->\n&lt;p>\uff0b\u03b1\u3067\u3000\u30ad\u30e3\u30c3\u30c1\u30b3\u30d4\u30fc\u306a\u3069\u3092\u3075\u308f\u3063\u3068\u3055\u305b\u308b\u306b\u306f\u3000\u4ee5\u4e0b\u306eHTML\u3000\u305d\u306e\u4ed6\u306f\u4e0a\u8a18\u3068\u540c\u3058&lt;\/p>\n &lt;div class=\"js-scroll-trigger\">\r\n        &lt;div class=\"multiple-item u-fade-type-up\">\r\n            \u30e1\u30a4\u30f3\u30b3\u30d4\u30fc\u30e1\u30a4\u30f3\u30b3\u30d4\u30fc\r\n        &lt;\/div>\r\n&lt;div class=\"multiple-item u-fade-type-up\">\r\n           \u30b5\u30d6\u30b3\u30d4\u30fc\r\n        &lt;\/div>\r\n &lt;\/div><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-jquery-js"],"_links":{"self":[{"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/posts\/147","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/gaku-on.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":4,"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"predecessor-version":[{"id":152,"href":"http:\/\/gaku-on.com\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions\/152"}],"wp:attachment":[{"href":"http:\/\/gaku-on.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/gaku-on.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/gaku-on.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}