{"id":569,"date":"2017-02-15T20:53:34","date_gmt":"2017-02-15T11:53:34","guid":{"rendered":"http:\/\/www.clarenet.co.jp\/column\/engineer\/?p=569"},"modified":"2017-02-15T20:53:34","modified_gmt":"2017-02-15T11:53:34","slug":"swiper-js","status":"publish","type":"post","link":"https:\/\/4koma-web.com\/coding\/swiper-js\/","title":{"rendered":"Swiper.js"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/www.clarenet.co.jp\/column\/engineer\/wp-content\/uploads\/2017\/02\/idangero.us-swiper-.png\" alt=\"\" width=\"1152\" height=\"568\" class=\"alignnone size-full wp-image-572\" \/><br \/>\n<a href=\"http:\/\/idangero.us\/swiper\/\" target=\"_blank\">http:\/\/idangero.us\/swiper\/<\/a><\/p>\n<p>Swiper.js\u306f\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30b9\u30e9\u30a4\u30c0\u30fc\u3068\u3057\u3066\u304a\u3059\u3059\u3081\u3067\u3059\u3002<\/p>\n<p>DEMO\u30da\u30fc\u30b8\u306b\u306f\u30aa\u30fc\u30bd\u30c9\u30c3\u30af\u30b9\u306a\u30ab\u30eb\u30fc\u30bb\u30eb\u4ee5\u5916\u306b\u3082\u3001\u69d8\u3005\u306a\u30bf\u30a4\u30d7\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u7528\u610f\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3055\u3089\u306b\u3001\u5145\u5b9f\u3057\u305fAPI\u3068\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u306b\u3088\u3063\u3066\u69d8\u3005\u306a\u95a2\u6570\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<blockquote><p>\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3068\u306f\u2026\u3000\u4ed6\u95a2\u6570\u306e\u5f15\u6570\u3068\u3057\u3066\u3001\u7279\u5b9a\u306e\u30bf\u30a4\u30df\u30f3\u30b0\u3067\u5b9f\u884c\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\u4f8b\uff09\u300c\u51e6\u7406A\u304c\u7d42\u308f\u3063\u305f\u5f8c\u306b\u3001\u51e6\u7406B\u3092\u5b9f\u884c\u3057\u305f\u3044\u300d<\/p><\/blockquote>\n<p>\n\u904e\u53bb\u306e\u4f7f\u7528\u5b9f\u7e3e\u3068\u3057\u3066\u306f\u3001\u5168\u753b\u9762\u30bf\u30a4\u30d7\u306e\u30b9\u30e9\u30a4\u30c9\u3092\uff16\u679a\u307e\u3067\u81ea\u52d5\u518d\u751f\uff0b\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u3067\u3082\u30da\u30fc\u30b8\u9001\u308a\u3001<br \/>\n\u6700\u5f8c\u306e\u30b9\u30e9\u30a4\u30c9\u306b\u5230\u9054\u3057\u305f\u6642\u70b9\u3067\u30db\u30a4\u30fc\u30eb\u5224\u5b9a\u3092\u7121\u52b9\u5316\u3057\u4e0b\u90e8\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u898b\u305b\u308b\u3002<br \/>\n\u3068\u3044\u3063\u305f\u30b9\u30e9\u30a4\u30c0\u30fc\u3092\u5b9f\u88c5\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\n\u57fa\u672c\u306eHTML\u69cb\u9020\u3068\u3057\u3066\u306f\u4e0b\u8a18\u3002<\/p>\n<pre class=\"lang:default decode:true \" >&lt;!-- Slider main container --&gt;\n&lt;div class=\"swiper-container\"&gt;\n    &lt;!-- Additional required wrapper --&gt;\n    &lt;div class=\"swiper-wrapper\"&gt;\n        &lt;!-- Slides --&gt;\n        &lt;div class=\"swiper-slide\"&gt;Slide 1&lt;\/div&gt;\n        &lt;div class=\"swiper-slide\"&gt;Slide 2&lt;\/div&gt;\n        &lt;div class=\"swiper-slide\"&gt;Slide 3&lt;\/div&gt;\n        ...\n    &lt;\/div&gt;\n    &lt;!-- If we need pagination --&gt;\n    &lt;div class=\"swiper-pagination\"&gt;&lt;\/div&gt;\n    \n    &lt;!-- If we need navigation buttons --&gt;\n    &lt;div class=\"swiper-button-prev\"&gt;&lt;\/div&gt;\n    &lt;div class=\"swiper-button-next\"&gt;&lt;\/div&gt;\n    \n    &lt;!-- If we need scrollbar --&gt;\n    &lt;div class=\"swiper-scrollbar\"&gt;&lt;\/div&gt;\n&lt;\/div&gt;<\/pre>\n<p>\nCSS\u306f\u3053\u3061\u3089<\/p>\n<pre class=\"lang:css decode:true \" >html, body {\n        position: relative;\n        height: 100%;\n    }\n    body {\n        background: #eee;\n        font-family: Helvetica Neue, Helvetica, Arial, sans-serif;\n        font-size: 14px;\n        color:#000;\n        margin: 0;\n        padding: 0;\n    }\n    .swiper-container {\n        width: 100%;\n        height: 100%;\n    }\n    .swiper-slide {\n        text-align: center;\n        font-size: 18px;\n        background: #fff;\n        \/* Center slide text vertically *\/\n        display: -webkit-box;\n        display: -ms-flexbox;\n        display: -webkit-flex;\n        display: flex;\n        -webkit-box-pack: center;\n        -ms-flex-pack: center;\n        -webkit-justify-content: center;\n        justify-content: center;\n        -webkit-box-align: center;\n        -ms-flex-align: center;\n        -webkit-align-items: center;\n        align-items: center;\n    }<\/pre>\n<p>Script\u90e8\u5206\u306f\u3053\u3093\u306a\u611f\u3058<\/p>\n<pre class=\"lang:js decode:true \" >&lt;script&gt;\n    var swiper = new Swiper('.swiper-container', {\n        pagination: '.swiper-pagination', \/\/\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u8868\u793a\n        paginationClickable: true, \/\/\u30da\u30fc\u30b8\u30cd\u30fc\u30b7\u30e7\u30f3\u306e\u30af\u30ea\u30c3\u30af\u6709\u52b9\n        direction: 'vertical', \/\/\u5782\u76f4\u65b9\u5411\u306b\u52d5\u4f5c\n        loop: true, \/\/\u30eb\u30fc\u30d7\u52d5\u4f5c\n        autoplay: 5000, \/\/\u81ea\u52d5\u518d\u751f\u958b\u59cb\u307e\u3067\u306e\u5f85\u3061\u6642\u9593\n        speed: 500, \/\/\u30b9\u30e9\u30a4\u30c9\u306e\u5207\u308a\u66ff\u3048\u306b\u8981\u3059\u308b\u6642\u9593\n        mousewheelControl: true, \/\/\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u3067\u30da\u30fc\u30b8\u9001\u308a\n        queueEndCallbacks: true,\n        onReachEnd: function(){ \/\/\u6700\u5f8c\u306e\u30b9\u30e9\u30a4\u30c9\u307e\u3067\u9054\u3057\u305f\u3068\u304d\u306b\u5b9f\u884c\u3059\u308b\u51e6\u7406\n            swiper.disableMousewheelControl(); \/\/\u30de\u30a6\u30b9\u30db\u30a4\u30fc\u30eb\u5224\u5b9a\u3092\u7121\u52b9\u5316\n            swiper.disableTouchControl(); \/\/\u30bf\u30c3\u30c1\u5224\u5b9a\u3092\u7121\u52b9\u5316\n        },\n          \n        });\n\n&lt;\/script&gt;\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>http:\/\/idangero.us\/swiper\/ Swiper.js\u306f\u30ec\u30b9\u30dd\u30f3\u30b7\u30d6\u5bfe\u5fdc\u306e\u30b3\u30f3\u30c6\u30f3\u30c4\u30b9\u30e9\u30a4\u30c0\u30fc\u3068\u3057\u3066\u304a\u3059\u3059\u3081\u3067\u3059\u3002 DEMO\u30da\u30fc\u30b8\u306b\u306f\u30aa\u30fc\u30bd\u30c9\u30c3\u30af\u30b9\u306a\u30ab\u30eb\u30fc\u30bb\u30eb\u4ee5\u5916\u306b\u3082\u3001\u69d8\u3005\u306a\u30bf\u30a4\u30d7\u306e\u30b5\u30f3\u30d7\u30eb\u304c\u7528\u610f\u3055\u308c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":572,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"","_original_post":"","footnotes":""},"categories":[1],"tags":[],"publishpress_future_action":{"enabled":false,"date":"2026-04-21 23:13:21","action":"change-status","newStatus":"draft","terms":[],"taxonomy":"category"},"_links":{"self":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/569"}],"collection":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/comments?post=569"}],"version-history":[{"count":0,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/posts\/569\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/media?parent=569"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/categories?post=569"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/4koma-web.com\/coding\/wp-json\/wp\/v2\/tags?post=569"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}