Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <!--
JQUERY SLIDER BY JohnRostislavovich - https://codepen.io/JohnRostislavovich
ALL YOU HAVE TO DO:
-copy the whole code html, css & js
-include jquery lib
-change the images
-->
<div id="slideshow">
   <div class="slideitem current">
     <img src="http://basik.ru/images/1920x1080_63/15_1920x1080.jpg">
   </div>
   <div class="slideitem">
     <img src="http://i2.fastpic.ru/big/2010/0321/36/49436230f02b95ce11f903fc8f683936.jpg">
   </div>
   <div class="slideitem">
     <img src="http://k37.kn3.net/1B107A604.jpg">
   </div>
   <div class="slideitem">
     <img src="http://wallpaperscraft.com/image/87654/1920x1080.jpg">
   </div>
   <div class="slideitem">
     <img src="http://hdwallpaperbackgrounds.net/wp-content/uploads/2015/09/Skyrim-Full-HD-1920x1080-Wallpapers.jpg">
   </div>
   <div class="slideitem">
     <img src="http://mirtajn.com/uploads/posts/2013-01/1359577392_high_altitude_eclipse_by_nethskie-d2xq0ww.jpg">
   </div>
   <div class="slideitem">
     <img src="http://img15.nnm.me/3/4/2/b/2/3f06025f75b6fd3544b947da06f.jpg">
   </div>
</div>

              
            
!

CSS

              
                #slideshow { 
    margin: 0 auto; 
    position: relative; 
    width: 100%;
    padding: 1% 1% 56.25% 1%; /*56.25 is for 16x9 resolution*/
		border-radius:20px;
		background: rgba(0,0,0,0.2);
    box-shadow: 0 0 20px rgba(0,0,0,0.6);
  box-sizing:border-box;
}

#slideshow > div { 
    position: absolute; 
    top: 10px; 
    left: 10px; 
    right: 10px; 
    bottom: 10px; 
}

#slideshow > div > img {
	width:100%;
	height:100%;
	border-radius:20px;
}

#slideshow:hover i, #slideshow:hover .slider-dots{
	opacity: 1;
	}

.slidebtn {
	z-index:99;
	background:transparent;
	outline:none;
	border:none;
	-webkit-transition: all 0.3s;
	-moz-transition: all 0.3s;
	transition: all 0.3s;
	padding:0 10px 0 10px;
	}

.slidebtn:active,
.slidedtn:focus {
	outline:none;}
	
.slidebtn i {
	color:#FFF;
	font-size:72px;
	opacity: 0.2;
	-webkit-transition: all 0.3s;
	-moz-transition: all 0.3s;
	transition: all 0.3s;

	}

.prev {
    position: absolute; 
    top: 10px; 
    left: 10px; 
    bottom: 10px;
}

.next {
    position: absolute; 
    top: 10px; 
    right: 10px; 
    bottom: 10px;
}


.slider-dots {
	opacity: 0.2;
  list-style: none;
  display: inline-block;
  padding-left: 0;
  margin-bottom: 0;
  position:absolute;
  left:50%;
  bottom:3%;
  transform: translate(-50%, 0);
  z-index:99;
  -webkit-transition: all 0.3s;
	-moz-transition: all 0.3s;
	transition: all 0.3s;

}

.slider-dots li {
  color: #000;
  display: inline;
  font-size: 48px;
  margin-right: 5px;
  cursor:pointer;
}

.slider-dots li.active-dot {
  color: #fff;
}

/*
JQUERY SLIDER BY JohnRostislavovich - https://codepen.io/JohnRostislavovich
ALL YOU HAVE TO DO:
-copy the whole code html, css & js
-include jquery lib
-change the images
*/

              
            
!

JS

              
                $(document).ready(function(){

$("#slideshow > div:gt(0)").hide();

var buttons = "<button class=\"slidebtn prev\"><i class=\"fa fa-chevron-circle-left\"></i></button><button class=\"slidebtn next\"><i class=\"fa fa-chevron-circle-right\"></i></button\>";

var slidesl = $('.slideitem').length
var d = "<li class=\"dot active-dot\">&bull;</li>";
for (var i = 1; i < slidesl; i++) {
  d = d+"<li class=\"dot\">&bull;</li>";
}	
var dots = "<ul class=\"slider-dots\">" + d + "</ul\>";

$("#slideshow").append(dots).append(buttons);
var interval = setInterval(slide, 3000);

function intslide(func) {
	if (func == 'start') { 
 	interval = setInterval(slide, 3000);
	} else {
		clearInterval(interval);		
		}
}

function slide() {
		sact('next', 0, 1200);
}
	
function sact(a, ix, it) {
        var currentSlide = $('.current');
        var nextSlide = currentSlide.next('.slideitem');
        var prevSlide = currentSlide.prev('.slideitem');
		    var reqSlide = $('.slideitem').eq(ix);

		    var currentDot = $('.active-dot');
    	  var nextDot = currentDot.next();
    	  var prevDot = currentDot.prev();
		    var reqDot = $('.dot').eq(ix);
		
        if (nextSlide.length == 0) {
      		nextDot = $('.dot').first();
            nextSlide = $('.slideitem').first();
            }

        if (prevSlide.length == 0) {
      		prevDot = $('.dot').last();
            prevSlide = $('.slideitem').last();
            }
			
		if (a == 'next') {
			var Slide = nextSlide;
			var Dot = nextDot;
			}
			else if (a == 'prev') {
				var Slide = prevSlide;
				var Dot = prevDot;
				}
				else {
					var Slide = reqSlide;
					var Dot = reqDot;
					}

        currentSlide.fadeOut(it).removeClass('current');
        Slide.fadeIn(it).addClass('current');
		
    	currentDot.removeClass('active-dot');
    	Dot.addClass('active-dot');
}	

$('.next').on('click', function(){
		intslide('stop');						
		sact('next', 0, 400);
		intslide('start');						
	});//next

$('.prev').on('click', function(){
		intslide('stop');						
		sact('prev', 0, 400);
		intslide('start');						
	});//prev

$('.dot').on('click', function(){
		intslide('stop');
		var index  = $(this).index();
		sact('dot', index, 400);
		intslide('start');						
	});//prev
//slideshow
});

/*
JQUERY SLIDER BY JohnRostislavovich - https://codepen.io/JohnRostislavovich
ALL YOU HAVE TO DO:
-copy the whole code html, css & js
-include jquery lib
-change the images
*/

              
            
!
999px

Console