{"id":10167,"date":"2017-06-13T20:01:17","date_gmt":"2017-06-13T11:01:17","guid":{"rendered":"https:\/\/nxpg.net\/blog\/?p=10167"},"modified":"2019-07-18T10:44:06","modified_gmt":"2019-07-18T01:44:06","slug":"scrollmagic%e3%82%92%e4%bd%bf%e3%81%a3%e3%81%9f%e8%bf%bd%e5%be%93%e3%83%a1%e3%83%8b%e3%83%a5%e3%83%bc%e3%83%bb%e8%bf%bd%e5%be%93%e3%82%b5%e3%82%a4%e3%83%89%e3%83%90%e3%83%bc%e3%81%ae%e5%ae%9f%e8%a3%85","status":"publish","type":"post","link":"https:\/\/nxpg.net\/blog\/tech\/?p=10167","title":{"rendered":"ScrollMagic\u3092\u4f7f\u3063\u305f\u8ffd\u5f93\u30e1\u30cb\u30e5\u30fc\u30fb\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u5b9f\u88c5\u4f8b\u3002"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-full wp-image-10175\" src=\"https:\/\/nxpg.net\/blog\/wp-content\/uploads\/2017\/06\/andre_170612_eyecatch.jpg\" alt=\"\" width=\"720\" height=\"480\"><\/p>\n<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a2\u30f3\u30c9\u30ec\u3067\u3059\u3002<br \/>\n\u4ee5\u524d\u3001<a href=\"https:\/\/nxpg.net\/blog\/?p=4634\">ScrollMagic\u306e\u30d1\u30e9\u30e9\u30c3\u30af\u30b9\u30b5\u30f3\u30d7\u30eb\u3092\u89e3\u8aac<\/a>\u3057\u307e\u3057\u305f\u304c\u3001\u3084\u306f\u308a\u3001\u300c\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u5fdc\u3058\u3066\u25cb\u25cb\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u306f\u3088\u304f\u3042\u308b\u3054\u8981\u671b\u3067\u3001\u305d\u3046\u3044\u3063\u305f\u969b\u306bScrollMagic\u306f\u3068\u3066\u3082\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u3059\u3002<br \/>\n\u305d\u3053\u3067\u4eca\u56de\u306f\u3001ScrollMagic\u3092\u4f7f\u3063\u3066\u3067\u304d\u308b\u3053\u3068\u306e\u4e00\u4f8b\u3068\u3057\u3066\u3001\u30da\u30fc\u30b8\u306e\u9014\u4e2d\u304b\u3089\u8ffd\u5f93\u3059\u308b\u30e1\u30cb\u30e5\u30fc\u30fb\u30b5\u30a4\u30c9\u30d0\u30fc\u306e\u5b9f\u88c5\u4f8b\u3092\u3054\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<h2>\u8ffd\u5f93\u30e1\u30cb\u30e5\u30fc<\/h2>\n<p class=\"codepen\" data-height=\"300\" data-theme-id=\"21128\" data-slug-hash=\"vgEWOy\" data-default-tab=\"result\" data-user=\"NP-okada\" data-embed-version=\"2\" data-pen-title=\"\u8ffd\u5f93\u30e1\u30cb\u30e5\u30fc\">See the Pen <a href=\"https:\/\/codepen.io\/NP-okada\/pen\/vgEWOy\/\">\u8ffd\u5f93\u30e1\u30cb\u30e5\u30fc<\/a> by Takamasa Okada (<a href=\"https:\/\/codepen.io\/NP-okada\">@NP-okada<\/a>) on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/p>\n<h3>\u30b3\u30fc\u30c9\u3068\u89e3\u8aac<\/h3>\n<pre>var controller = new ScrollMagic.Controller();\n\nvar scene = new ScrollMagic.Scene({\n\t\ttriggerElement: '#menu',\n\t\ttriggerHook: 0,\n\t})\n\t.setPin('#menu')\n\t.addIndicators()\n\t.addTo(controller);\n<\/pre>\n<p>\u6700\u521d\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u306e\u53cd\u5fdc\u9818\u57df\uff08Scene\uff09\u3092\u7ba1\u7406\u3059\u308b\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff08Controller\uff09\u3092\u5909\u6570\u306b\u683c\u7d0d\u3057\u3001\u305d\u306e\u5f8cScene\u3092\u751f\u6210\u3057\u3066Controller\u306b\u8ffd\u52a0\u3059\u308b\u3001\u3068\u3044\u3046\u57fa\u672c\u306e\u6d41\u308c\u306f\u3044\u3064\u3082\u901a\u308a\u3067\u3059\u3002<\/p>\n<p>Scene\u3092\u751f\u6210\u3059\u308b\u969b\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3001<br \/>\n<small style=\"color: #666;\"><br \/>\ntriggerElement: &#8216;#menu&#8217;\uff08Scene\u958b\u59cb\u5730\u70b9\u3092id=&#8221;menu&#8221;\u306e\u8981\u7d20\u306b\u6307\u5b9a\uff09<br \/>\ntriggerHook: 0\uff08\u3069\u306e\u4f4d\u7f6e\u3067Scene\u958b\u59cb\u5730\u70b9\u3092\u6349\u3048\u308b\u304b\u30010\u306a\u3089\u753b\u9762\u6700\u4e0a\u90e8\u30011\u306a\u3089\u753b\u9762\u6700\u4e0b\u90e8\uff09<br \/>\n<\/small><\/p>\n<p>\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u3067\u3001id=&#8221;menu&#8221;\u306e\u8981\u7d20\u304c\u753b\u9762\u6700\u4e0a\u90e8\u306b\u6765\u305f\u3089\u52d5\u4f5c\u958b\u59cb\u3068\u306a\u308a\u307e\u3059\u3002<br \/>\n\u8ffd\u5f93\uff08\uff1d\u8981\u7d20\u306e\u56fa\u5b9a\uff09\u306b\u306fScene\u304c\u6301\u3063\u3066\u3044\u308b\u30e1\u30bd\u30c3\u30c9\u306esetPin\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002setPin\u306e\u7b2c1\u5f15\u6570\u306b&#8217;#menu&#8217;\u3092\u6307\u5b9a\u3057\u3001id=&#8221;menu&#8221;\u306e\u8981\u7d20\u3092\u56fa\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<p>\u305f\u3063\u305f\u3053\u308c\u3060\u3051\u3067\u3059\uff01<br \/>\n<small style=\"margin-bottom: 3rem;\">\uff08addIndicators\u306f\u30c7\u30d0\u30c3\u30b0\u7528\u306b\u30a4\u30d9\u30f3\u30c8\u30c8\u30ea\u30ac\u30fc\u7b49\u3092\u53ef\u8996\u5316\u3059\u308b\u3060\u3051\u3067\u3059\uff09<\/small><\/p>\n<p>\u3061\u306a\u307f\u306b\u8ffd\u5f93\u30d8\u30c3\u30c0\u30fc\u304c\u3042\u308b\u5834\u5408\u306f\u3001Scene\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b<\/p>\n<p><small style=\"color: #666;\">offset: -\uff08\u30de\u30a4\u30ca\u30b9\uff09\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055<\/small><\/p>\n<p>\u3092\u6307\u5b9a\u3057\u3066\u3084\u308b\u3068\u3001\u753b\u9762\u6700\u4e0a\u90e8\u304b\u3089\u30d8\u30c3\u30c0\u30fc\u306e\u9ad8\u3055\u5206\u30ba\u30ec\u3066\u8ffd\u5f93\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc<\/h2>\n<p class=\"codepen\" data-height=\"300\" data-theme-id=\"21128\" data-slug-hash=\"xrZrGM\" data-default-tab=\"result\" data-user=\"NP-okada\" data-embed-version=\"2\" data-pen-title=\"\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc\">See the Pen <a href=\"https:\/\/codepen.io\/NP-okada\/pen\/xrZrGM\/\">\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc<\/a> by Takamasa Okada (<a href=\"https:\/\/codepen.io\/NP-okada\">@NP-okada<\/a>) on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/p>\n<h3>\u30b3\u30fc\u30c9\u3068\u89e3\u8aac<\/h3>\n<pre>var controller = new ScrollMagic.Controller();\n\nvar scene = new ScrollMagic.Scene({\n\t\ttriggerElement: '#main',\n\t\ttriggerHook: 0,\n\t\tduration: getDuration,\n\t})\n\t.setPin('#aside__inner')\n\t.addIndicators()\n\t.addTo(controller);\n\nfunction getDuration() {\n\treturn $('#main').height() - $('#aside__inner').innerHeight();\n}\n<\/pre>\n<p>\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc\u306f\u3001\u30e1\u30a4\u30f3\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u9593\u3067\u306e\u307f\u8ffd\u5f93\u3059\u308b\u3088\u3046\u306b\u3001duration\u3092\u6307\u5b9a\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\nduration\u306b\u306f\u95a2\u6570\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001\u52d5\u7684\u306b\u6570\u5024\u3092\u8fd4\u3059\u95a2\u6570\u3092\u6307\u5b9a\u3059\u308c\u3070\u3001\u753b\u9762\u306e\u30ea\u30b5\u30a4\u30ba\u7b49\u306b\u3082\u5bfe\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\uff08\u518d\u53d6\u5f97\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u30670.1\u79d2\u6bce\uff09\u3002<br \/>\n\u4eca\u56de\u306fgetDuration\u3068\u3044\u3046\u95a2\u6570\u3092\u5b9a\u7fa9\u3057\u3001\u30e1\u30a4\u30f3\u30b3\u30f3\u30c6\u30f3\u30c4\uff08#main\uff09\u306e\u9ad8\u3055\u304b\u3089\u30b5\u30a4\u30c9\u30d0\u30fc\uff08#aside__inner\uff09\u81ea\u8eab\u306e\u9ad8\u3055\u3092\u5f15\u3044\u305f\u6570\u5024\u3092\u8fd4\u3059\u3053\u3068\u3067\u3001\u30e1\u30a4\u30f3\u30b3\u30f3\u30c6\u30f3\u30c4\u306e\u9593\u3067\u306e\u307f\u8ffd\u5f93\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u305d\u306e\u4ed6\u306e\u6ce8\u610f\u70b9\u3068\u3057\u3066\u306f\u3001setPin\u30e1\u30bd\u30c3\u30c9\u3092\u6307\u5b9a\u3057\u305f\u8981\u7d20\u306f\u3001ScrollMagic\u304c\u751f\u6210\u3059\u308bdiv\u3067\u30e9\u30c3\u30d7\u3055\u308c\u3001\u305d\u306ediv\u306b\u306f\u8981\u7d20\u56fa\u5b9a\u306e\u70ba\u306estyle\u304c\u5f53\u305f\u308b\u306e\u3067\u3001\u30ec\u30a4\u30a2\u30a6\u30c8\u7cfb\u306eCSS\u3092\u6307\u5b9a\u3057\u3066\u3044\u308b\u8981\u7d20\uff08\u4eca\u56de\u3060\u3068float: right\u3092\u6307\u5b9a\u3057\u3066\u3044\u308baside\u8981\u7d20\uff09\u3092\u6307\u5b9a\u3059\u308b\u3068\u5177\u5408\u304c\u60aa\u304b\u3063\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3044\u3046\u5834\u5408\u306f\u3001\u4f8b\u306e#aside__inner\u306e\u3088\u3046\u306b\u3001div\u30921\u3064\u631f\u3093\u3067\u3084\u308b\u3068\u826f\u3044\u3067\u3059\u3002<\/p>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u8ffd\u5f93\u30e1\u30cb\u30e5\u30fc\u306b\u95a2\u3057\u3066\u306f\u3001\u305d\u308c\u5c02\u7528\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u3063\u305f\u3053\u3068\u3082\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u5c02\u7528\u306e\u5272\u306b\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u304c\u3057\u306b\u304f\u304b\u3063\u305f\u308a\u3057\u305f\u306e\u3067\u3001\u7d50\u5c40ScrollMagic\u306b\u843d\u3061\u7740\u304d\u307e\u3057\u305f\uff08setPin\u30e1\u30bd\u30c3\u30c9\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u5b9f\u969b\u305d\u306e\u7528\u9014\u3082\u8003\u616e\u3055\u308c\u3066\u3044\u308b\u3068\u601d\u3044\u307e\u3059\uff09\u3002<br \/>\n\u307e\u305f\u3001\u8ffd\u5f93\u30b5\u30a4\u30c9\u30d0\u30fc\u306f\u81ea\u5206\u3067\u30b3\u30fc\u30c9\u3092\u66f8\u3044\u305f\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3059\u304c\u3001\u8a18\u8ff0\u304c\u306a\u304b\u306a\u304b\u7169\u96d1\u306b\u306a\u3063\u3066\u3057\u307e\u3063\u305f\u8a18\u61b6\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u305d\u3046\u3044\u3063\u305f\u3001\u8907\u96d1\u30fb\u7169\u96d1\u306b\u306a\u308a\u304c\u3061\u306a\u30b9\u30af\u30ed\u30fc\u30eb\u30a4\u30d9\u30f3\u30c8\u3092\u3001\u7c21\u5358\u306a\u6307\u5b9a\u3067\u307e\u3068\u3081\u3066\u7ba1\u7406\u3067\u304d\u308bScrollMagic\u306f\u975e\u5e38\u306b\u4fbf\u5229\u306a\u306e\u3067\u3001\u7686\u3055\u3093\u3082\u305c\u3072\u6d3b\u7528\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<p><script src=\"\/\/assets.codepen.io\/assets\/embed\/ei.js\" async=\"\"><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30a2\u30f3\u30c9\u30ec\u3067\u3059\u3002 \u4ee5\u524d\u3001ScrollMagic\u306e\u30d1\u30e9\u30e9\u30c3\u30af\u30b9\u30b5\u30f3\u30d7\u30eb\u3092\u89e3\u8aac\u3057\u307e\u3057\u305f\u304c\u3001\u3084\u306f\u308a\u3001\u300c\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u5fdc\u3058\u3066\u25cb\u25cb\u3059\u308b\u300d\u3068\u3044\u3046\u306e\u306f\u3088\u304f\u3042\u308b\u3054\u8981\u671b\u3067\u3001\u305d\u3046\u3044\u3063\u305f\u969b\u306bScrollMagic\u306f\u3068\u3066\u3082\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9 [&hellip;]<\/p>\n","protected":false},"author":9,"featured_media":13058,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[6],"tags":[7],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/posts\/10167"}],"collection":[{"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10167"}],"version-history":[{"count":2,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/posts\/10167\/revisions"}],"predecessor-version":[{"id":13492,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/posts\/10167\/revisions\/13492"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=\/wp\/v2\/media\/13058"}],"wp:attachment":[{"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nxpg.net\/blog\/tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}