Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation


Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

                <div class="touch-slider">
    <a class="arrow-left" href="#"></a>
    <a class="arrow-right" href="#"></a>
    <div class="swiper-container">
      <div class="swiper-wrapper">

        <div class="swiper-slide"><img src="http://lorempixel.com/output/nature-q-c-640-480-9.jpg"></div>
        <div class="swiper-slide"><img src="http://lorempixel.com/output/nature-q-c-640-480-7.jpg"></div>
        <div class="swiper-slide"><img src="http://lorempixel.com/output/nature-q-c-640-480-3.jpg"></div>

    <div class="pagination"></div>
  <script src="https://dl.dropboxusercontent.com/u/913021/touch-slider/idangerous.swiper-2.0.min.js"></script>
              body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background-color: #d8d0a7;
.touch-slider {
	margin: 5px auto;
  width: 600px;
  height: 240px;
  background: #111;
  position: relative;

.touch-slider .arrow-left,
.touch-slider .arrow-right {
	position: absolute;
  top: 50%;
  margin-top: -15px;
  width: 17px;
  height: 30px;
	z-index: 10000;
.touch-slider .arrow-left { background: url("https://dl.dropboxusercontent.com/u/913021/touch-slider/arrows.png") no-repeat left top; left: 5px; opacity: 0;}
.touch-slider .arrow-right { background: url("https://dl.dropboxusercontent.com/u/913021/touch-slider/arrows.png") no-repeat left bottom; right: 5px; opacity: 0; }

.touch-slider:hover > .arrow-left,
.touch-slider:hover > .arrow-right { opacity: 1; transition: all 0.7s ease; }

.swiper-container {
  height: 240px;
  width: 600px;
.content-slide {
  color: #fff;

.content-slide .content-image {
	position: absolute;
	z-index: -1;

.content-slide .content-text {
	margin: 0 0 0 530px;
	padding: 20px;
	width: 220px;
	height: 200px;
	position: absolute;
	z-index: 2;

	background: rgb(1,25,37); /* Old browsers */
	background: -moz-linear-gradient(-45deg,  rgba(1,25,37,1) 0%, rgba(2,90,136,1) 100%); /* FF3.6+ */
	background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(1,25,37,1)), color-stop(100%,rgba(2,90,136,1))); /* Chrome,Safari4+ */
	background: -webkit-linear-gradient(-45deg,  rgba(1,25,37,1) 0%,rgba(2,90,136,1) 100%); /* Chrome10+,Safari5.1+ */
	background: -o-linear-gradient(-45deg,  rgba(1,25,37,1) 0%,rgba(2,90,136,1) 100%); /* Opera 11.10+ */
	background: -ms-linear-gradient(-45deg,  rgba(1,25,37,1) 0%,rgba(2,90,136,1) 100%); /* IE10+ */
	background: linear-gradient(135deg,  rgba(1,25,37,1) 0%,rgba(2,90,136,1) 100%); /* W3C */
	filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#011925', endColorstr='#025a88',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */

.content-text a { color: #FFF; }
.content-text a:hover { text-decoration: none; }

.pagination {
	margin-left: 5px;
  left: 0;
  width: 100%;
  z-index: 10000;
  position: absolute;
.swiper-pagination-switch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 10px;
  background: #FFF;
  box-shadow: 0px 1px 2px #000 inset;
  margin: 0 3px;
  cursor: pointer;
.swiper-active-switch {
  background: #831E3B;

 * Swiper - Mobile Touch Slider CSS
 * https://www.idangero.us/sliders/swiper
 * Vladimir Kharlampidi, The iDangero.us
 * https://www.idangero.us/
 * Copyright 2012-2013, Vladimir Kharlampidi
 * The iDangero.us
 * https://www.idangero.us
 * Licensed under GPL & MIT

/* ===============================================================
Basic Swiper Styles
.swiper-container {
	margin:0 auto;
	/* Fix of Webkit flickering */
.swiper-wrapper {
	-webkit-transition-property:-webkit-transform, left, top;

	-moz-transition-property:-moz-transform, left, top;

	-o-transition-property:-o-transform, left, top;

	-ms-transition-property:-ms-transform, left, top;

	transition-property:transform, left, top;
.swiper-free-mode > .swiper-wrapper {
	-webkit-transition-timing-function: ease-out;
	-moz-transition-timing-function: ease-out;
	-ms-transition-timing-function: ease-out;
	-o-transition-timing-function: ease-out;
	transition-timing-function: ease-out;
	margin: 0 auto;
.swiper-slide {
	float: left;

/* IE10 Windows Phone 8 Fixes */
.swiper-wp8-horizontal {
	-ms-touch-action: pan-y;
.swiper-wp8-vertical {
	-ms-touch-action: pan-x;

/* ===============================================================
Your custom styles, here you need to specify container's and slide's
sizes, pagination, etc.
.swiper-container {
	/* Specify Swiper's Size: */

	height: 100px;*/
.swiper-slide {
	/* Specify Slides's Size: */

	/*width: 100%;
	height: 100%;*/
.swiper-slide-active {
	/* Specific active slide styling: */

.swiper-slide-visible {
	/* Specific visible slide styling: */

/* ===============================================================
Pagination Styles
.swiper-pagination-switch {
	/* Stylize pagination button: */

.swiper-active-switch {
	/* Specific active button style: */

.swiper-visible-switch {
	/* Specific visible button style: */


var mySwiper = new Swiper('.swiper-container',{
    onSlideChangeEnd: function () {

  $('.arrow-left').on('click', function(e){
   // alert(mySwiper.previousIndex)
  $('.arrow-right').on('click', function(e){
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.