{"id":4875,"date":"2019-10-31T14:57:53","date_gmt":"2019-10-31T05:57:53","guid":{"rendered":"http:\/\/www.otwo.jp\/blog\/?p=4875"},"modified":"2019-10-31T14:57:53","modified_gmt":"2019-10-31T05:57:53","slug":"custom-scroller","status":"publish","type":"post","link":"https:\/\/www.otwo.jp\/blog\/custom-scroller\/","title":{"rendered":"custom content scroller\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u65b9\u6cd5\u3010jQuery\u3011"},"content":{"rendered":"<p><img decoding=\"async\" loading=\"lazy\" src=\"http:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/10\/customscroller.png\" alt=\"\" width=\"700\" height=\"400\" class=\"alignnone size-full wp-image-4896\" srcset=\"https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/10\/customscroller.png 700w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/10\/customscroller-150x86.png 150w, https:\/\/www.otwo.jp\/blog\/wp-content\/uploads\/2019\/10\/customscroller-300x171.png 300w\" sizes=\"(max-width: 700px) 100vw, 700px\" \/><br \/>\n\u3053\u3093\u306b\u3061\u306f\u3001WEB\u306e\u4f50\u91ce\u3067\u3059\u3002<br \/>\n\u4eca\u56de\u306fWEB\u5236\u4f5c\u306b\u5f79\u7acb\u3064\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u5909\u66f4\u306e\u8a71\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u901a\u5e38\u306eWEB\u30b5\u30a4\u30c8\u5236\u4f5c\u3067\u306f\u4e2d\u3005\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u304c\u6c17\u306b\u306a\u308b\u5834\u9762\u3063\u3066\u5c11\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u30e2\u30fc\u30c0\u30eb\u7b49\u306e\u5c0f\u3055\u3044\u30b3\u30f3\u30c6\u30f3\u30c4\u306bcss\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u3092\u8868\u793a\u3055\u305b\u305f\u6642\u3001\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u8868\u793a\u3055\u308c\u3066\u3001\u898b\u305f\u76ee\u304c\u6d6e\u3044\u3066\u3057\u307e\u3046\u2026\u4f55\u3066\u3053\u3068\u304c\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u3093\u306a\u60a9\u307f\u3092\u89e3\u6d88\u3057\u3066\u304f\u308c\u308b\u3001jQuery\u30d7\u30e9\u30b0\u30a4\u30f3\u306e\u300ccustom content scroller\u300d\u3092\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<div class=\"pageContents\">\n<p class=\"title\">\u3082\u304f\u3058<\/p>\n<dl>\n<dt><a href=\"#step1\">custom content scroller\u3068\u306f<\/a><\/dt>\n<dt><a href=\"#step2\">\u5b9f\u88c5\u30b5\u30f3\u30d7\u30eb<\/a><\/dt>\n<dt><a href=\"#step3\">\u4f7f\u3044\u65b9<\/a><\/dt>\n<dt><a href=\"#step4\">\u30aa\u30d7\u30b7\u30e7\u30f3<\/a><\/dt>\n<dt><a href=\"#step5\">\u6700\u5f8c\u306b<\/a><\/dt>\n<\/dl>\n<\/div>\n<h2 id=\"step1\">custom content scroller\u3068\u306f<\/h2>\n<p>custom content scroller\u306f\u30d6\u30e9\u30a6\u30b6\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u3092\u5909\u66f4\u3067\u304d\u308bjQuery\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u3059\u3002<br \/>\n\u73fe\u5728\u306f-webkit-(chrome\u30fbsafari)\u306e\u307fcss\u3067\u30c7\u30b6\u30a4\u30f3\u5909\u66f4\u3067\u304d\u307e\u3059\u304c\u3001\u305d\u306e\u4ed6\u306e\u30d6\u30e9\u30a6\u30b6\u306f\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u3067\u5e45\u5e83\u304f\u5bfe\u5fdc\u3057\u3066\u3044\u308b\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u304b\u306a\u308a\u512a\u79c0\u306a\u3082\u306e\u3068\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u5b9f\u969b\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u3092\u5909\u66f4\u3057\u3066\u3044\u308b\u308f\u3051\u3067\u306f\u306a\u304f\u3001css+js\u3067\u7591\u4f3c\u7684\u306b\u30b9\u30af\u30ed\u30fc\u30eb\u3092\u8868\u73fe\u3057\u3066\u3044\u308b\u3082\u306e\u306a\u306e\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u5bfe\u3057\u3066js\u51e6\u7406(TOP\u3078\u623b\u308b\u306a\u3069)\u3092\u8a2d\u5b9a\u3057\u3066\u3044\u308b\u5834\u5408\u306f\u8abf\u6574\u304c\u5fc5\u8981\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<h2 id=\"step2\">\u5b9f\u88c5\u30b5\u30f3\u30d7\u30eb<\/h2>\n<p>custom content scroller\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u3092\u5909\u66f4\u3057\u305f\u30a4\u30e1\u30fc\u30b8\u306f\u3053\u3093\u306a\u611f\u3058\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u3069\u3093\u306a\u30c7\u30b6\u30a4\u30f3\u3067\u3082\u6d6e\u304f\u3053\u3068\u304c\u306a\u3044\u69d8\u306a\u30b9\u30de\u30fc\u30c8\u306a\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u304c\u5b9f\u88c5\u3067\u304d\u307e\u3059\u3002<br \/>\n\u8272\u3084\u30c7\u30b6\u30a4\u30f3\u306f\u3044\u304f\u3064\u304b\u30c6\u30fc\u30de\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u306e\u30673\u7a2e\u985e\u307b\u3069\u3002<\/p>\n<p class=\"codepen\" data-height=\"300\" data-theme-id=\"0\" data-default-tab=\"result\" data-user=\"otwo\" data-slug-hash=\"KKKmBjG\" style=\"height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;\" data-pen-title=\"KKKmBjG\">\n  <span>See the Pen <a href=\"https:\/\/codepen.io\/otwo\/pen\/KKKmBjG\"><br \/>\n  KKKmBjG<\/a> by otwo (<a href=\"https:\/\/codepen.io\/otwo\">@otwo<\/a>)<br \/>\n  on <a href=\"https:\/\/codepen.io\">CodePen<\/a>.<\/span>\n<\/p>\n<p><script async src=\"https:\/\/static.codepen.io\/assets\/embed\/ei.js\"><\/script><\/p>\n<h2 id=\"step3\">\u4f7f\u3044\u65b9<\/h2>\n<p>\u4f7f\u3044\u65b9\u306f\u51c4\u304f\u7c21\u5358\u3067\u3001\u307e\u305a\u306f\u4e0b\u8a18\u306e\u30b5\u30a4\u30c8\u304b\u3089\u30d5\u30a1\u30a4\u30eb\u3092\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u307e\u3059\u3002<\/p>\n<div class=\"externalLink\"><a href=\"http:\/\/manos.malihu.gr\/jquery-custom-content-scroller\/\" target=\"_blank\" rel=\"noopener noreferrer\">jQuery custom content scroller<\/a><\/div>\n<p>\u5fc5\u8981\u306a\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0b\u306e2\u30d5\u30a1\u30a4\u30eb\u306e\u307f\u3002<br \/>\n\u30fbjquery.mCustomScrollbar.min.css<br \/>\n\u30fbjquery.mCustomScrollbar.min.js<\/p>\n<p>\u3053\u308c\u3092\u5b9f\u88c5\u3059\u308bhtml\u30d5\u30a1\u30a4\u30eb\u3067\u8aad\u307f\u8fbc\u307e\u305b\u308c\u3070\u6e96\u5099OK\u3067\u3059\uff01<\/p>\n<h3>\u30b3\u30fc\u30c9\u306e\u66f8\u304d\u65b9<\/h3>\n<p>HTML\u306fcss\u306eoverflow\u3092\u4f7f\u3046\u6642\u3068\u540c\u3058\u69cb\u6210\u3067\u7d44\u3093\u3067\u304f\u3060\u3055\u3044\u3002<br \/>\n\u4e0b\u306e\u30b3\u30fc\u30c9\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u3092\u51fa\u3059\u5834\u5408\u306fCSS\u30af\u30e9\u30b9\u306escroll-area\u3092\u6307\u5b9a\u3057\u305fdiv\u306boverflow\u3092\u6307\u5b9a\u3057\u307e\u3059\u304c\u3001\u3053\u306e\u30d7\u30e9\u30b0\u30a4\u30f3\u3092\u4f7f\u7528\u3059\u308b\u5834\u5408\u306foverflow\u306e\u6307\u5b9a\u306f\u4e0d\u8981\u3068\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\"> &lt;body&gt;\r\n  &lt;div class=\"scroll-area\"&gt;\r\n   &lt;div class=\"scroll-content\"&gt;\r\n    \u3053\u3053\u306b\u8a18\u8ff0\u3057\u305f\u3082\u306e\u304c\u30b9\u30af\u30ed\u30fc\u30eb\u3067\u8868\u793a\u3055\u308c\u307e\u3059\u3002\r\n   &lt;\/div&gt;\r\n  &lt;\/div&gt;\r\n &lt;\/body&gt;\r\n<\/pre>\n<p>JavaScript\u306b\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u5834\u5408\u30011\u884c\u306e\u8a18\u8ff0\u3067\u30b9\u30af\u30ed\u30fc\u30eb\u3092\u5909\u66f4\u3067\u304d\u307e\u3059\u3002<br \/>\n\u30bb\u30ec\u30af\u30bf\u306b\u306f\u4e0a\u306ehtml\u3067\u5b9f\u88c5\u3059\u308b\u5834\u5408\u306escroll-area\u3092\u4f7f\u7528\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\"> &lt;script&gt;\r\n\u3000(function($){\r\n  \u3000$(\".scroll-area\").mCustomScrollbar();\r\n\u3000})(jQuery);\r\n &lt;\/script&gt;\r\n<\/pre>\n<h2 id=\"step4\">\u30aa\u30d7\u30b7\u30e7\u30f3<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306f\u4e0a\u8a18\u306e\u8a18\u8ff0\u3060\u3051\u3067\u4e8b\u8db3\u308a\u305d\u3046\u3067\u3059\u304c\u3001\u30b5\u30f3\u30d7\u30eb\u306e\u69d8\u306b\u30c6\u30fc\u30de\u3092\u5909\u3048\u305f\u308a\u3001TOP\u306b\u623b\u308b\u306a\u3069\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u3078\u306e\u51e6\u7406\u3092\u5b9f\u88c5\u3059\u308b\u70ba\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u5c11\u3057\u3060\u3051\u7d39\u4ecb\u3057\u307e\u3059\u3002<\/p>\n<h3>\u30c6\u30fc\u30de\u306e\u5909\u66f4<\/h3>\n<p>\u30d7\u30e9\u30b0\u30a4\u30f3\u3067\u7528\u610f\u3055\u308c\u3066\u3044\u308b\u30c6\u30fc\u30de\u306f\u4e0b\u8a18\u3067\u4e00\u901a\u308a\u898b\u308b\u4e8b\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<div class=\"externalLink\"><a href=\"http:\/\/manos.malihu.gr\/repository\/custom-scrollbar\/demo\/examples\/scrollbar_themes_demo.html\" target=\"_blank\" rel=\"noopener noreferrer\">jQuery custom scrollbar demo<\/a><\/div>\n<p>\u3053\u3061\u3089\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30c6\u30fc\u30de\u306e\u540d\u524d\u3092\u30d1\u30e9\u30e1\u30fc\u30bf\u306b\u8a2d\u5b9a\u3059\u308c\u3070\u5909\u66f4\u304c\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\"> &lt;script&gt;\r\n\u3000(function($){\r\n  \u3000$(\".scroll-area\").mCustomScrollbar({\r\n     theme:\"rounded-dots-dark\"\r\n    });\r\n\u3000})(jQuery);\r\n &lt;\/script&gt;\r\n<\/pre>\n<h3>\u81ea\u52d5\u30b9\u30af\u30ed\u30fc\u30eb<\/h3>\n<p>TOP\u306b\u623b\u308b\u3084\u30b3\u30f3\u30c6\u30f3\u30c4\u5185\u306e\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u4f7f\u7528\u3067\u304d\u308bscrollTo\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\n\u5f15\u6570\u306e2\u3064\u76ee\u306b\u306f\u4f4d\u7f6e\u3092\u6307\u5b9a\u3057\u3066\u304a\u308a\u3001\u4e0b\u8a18\u53c2\u8003\u3067\u306f\u4e00\u756a\u4e0a\u306b\u623b\u308b\u69d8\u306b&#8221;0&#8243;\u3092\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u4f4d\u7f6e\u306f%\u3084px\u306e\u6307\u5b9a\u3084&#8221;top&#8221;\u3084&#8221;bottom&#8221;\u3068\u8a00\u3063\u305f\u6307\u5b9a\u3082\u53ef\u80fd\u3067\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\"> &lt;script&gt;\r\n\u3000(function($){\r\n  \u3000$(\".scroll-area\").mCustomScrollbar('scrollTo','0');\r\n\u3000})(jQuery);\r\n &lt;\/script&gt;\r\n<\/pre>\n<p>\u307e\u305f\u3001\u30b9\u30af\u30ed\u30fc\u30eb\u306b\u304b\u304b\u308b\u6642\u9593\u3082\u30df\u30ea\u79d2\u3067\u6307\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"brush: python\r; notranslate\"> &lt;script&gt;\r\n\u3000(function($){\r\n  \u3000$(\".scroll-area\").mCustomScrollbar('scrollTo','0',{\r\n     scrollInertia:1000\r\n    });\r\n\u3000})(jQuery);\r\n &lt;\/script&gt;\r\n<\/pre>\n<p>\u4ed6\u306b\u3082\u8272\u3005\u306a\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u516c\u5f0f\u30b5\u30a4\u30c8\u3067\u8aac\u660e\u304c\u3055\u308c\u3066\u3044\u308b\u306e\u3067\u8208\u5473\u304c\u3042\u308c\u3070\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\uff01<\/p>\n<h2 id=\"step5\">\u6700\u5f8c\u306b<\/h2>\n<p>\u30b9\u30af\u30ed\u30fc\u30eb\u30c7\u30b6\u30a4\u30f3\u306e\u5909\u66f4\u306f\u7121\u3055\u305d\u3046\u3067\u610f\u5916\u3068\u3042\u308b\u4e8b\u3060\u3068\u601d\u3046\u306e\u3067\u3001\u4f7f\u3063\u305f\u4e8b\u304c\u7121\u3044\u65b9\u306f\u305c\u30721\u5ea6\u4f7f\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u624b\u8efd\u306b\u30aa\u30b7\u30e3\u30ec\u306b\u51fa\u6765\u3066\u611f\u52d5\u3057\u307e\u3059\u3002<br \/>\nCSS\u3067\u8272\u306a\u3069\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u51fa\u6765\u308b\u3088\u3046\u306a\u306e\u3067\u30b5\u30a4\u30c8\u30c7\u30b6\u30a4\u30f3\u306b\u5408\u3063\u305f\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3092\u3057\u3066\u307f\u308b\u306e\u3082\u826f\u3044\u304b\u3068\uff01<br \/>\n\u4f55\u306a\u3089\u81ea\u4f5c\u3057\u3066\u307f\u3066\u3082\u9762\u767d\u3044\u304b\u306a\u3068\uff01<\/p>\n<p>\u307e\u305f\u624b\u8efd\u3067\u4fbf\u5229\u306a\u30e9\u30a4\u30d6\u30e9\u30ea\u304c\u3042\u308c\u3070\u7d39\u4ecb\u3057\u307e\u3059\uff01<br \/>\n\u305d\u308c\u3067\u306f\u307e\u305f\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001WEB\u306e\u4f50\u91ce\u3067\u3059\u3002 \u4eca\u56de\u306fWEB\u5236\u4f5c\u306b\u5f79\u7acb\u3064\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u5909\u66f4\u306e\u8a71\u306b\u306a\u308a\u307e\u3059\u3002 \u901a\u5e38\u306eWEB\u30b5\u30a4\u30c8\u5236\u4f5c\u3067\u306f\u4e2d\u3005\u30b9\u30af\u30ed\u30fc\u30eb\u30d0\u30fc\u306e\u30c7\u30b6\u30a4\u30f3\u304c\u6c17\u306b\u306a\u308b\u5834\u9762\u3063\u3066\u5c11\u306a\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u304c\u3001\u30e2\u30fc\u30c0\u30eb\u7b49\u306e\u5c0f\u3055\u3044\u30b3\u30f3\u30c6 [&hellip;]<\/p>\n","protected":false},"author":25,"featured_media":4895,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[8],"tags":[93,94],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4875"}],"collection":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/comments?post=4875"}],"version-history":[{"count":22,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4875\/revisions"}],"predecessor-version":[{"id":4940,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/posts\/4875\/revisions\/4940"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media\/4895"}],"wp:attachment":[{"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/media?parent=4875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/categories?post=4875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.otwo.jp\/blog\/wp-json\/wp\/v2\/tags?post=4875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}