Pen Settings

HTML

CSS

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

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

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.

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

              
                <div class="slide-container">
	<div class="slide-items">
		<div class="slide-item active">
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat dolores nostrum modi, dolor, neque distinctio vel ut itaque numquam quos magni dolore ea earum tempore est excepturi perspiciatis, placeat odio.</p>
		</div><!-- .slide-item -->
		<div class="slide-item">
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Vero veritatis, porro beatae necessitatibus minima quos molestias! Voluptate adipisci iure velit quos, explicabo neque suscipit provident iusto soluta, aperiam libero, sed!</p>
		</div><!-- .slide-item -->
		<div class="slide-item">
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Facilis laboriosam reiciendis ipsum, possimus sed quia. Inventore natus dolorum laboriosam non voluptates saepe. Accusamus quia error voluptates sapiente molestiae facilis repellat!.</p>
		</div><!-- .slide-item -->
		<div class="slide-item">
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Alias, dolorum suscipit repellat quo porro sunt modi molestias quaerat excepturi nisi amet perferendis necessitatibus praesentium tempore ad quod quam, aperiam impedit.</p>
		</div><!-- .slide-item -->
		<div class="slide-item">
			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Veniam molestiae adipisci, consequuntur quaerat sequi harum omnis, quis quidem laborum, fugiat nemo dolores aspernatur natus. Sequi maxime praesentium ipsum quod! Accusamus.</p>
		</div><!-- .slide-item -->
	</div>

	<div class="slide-nav">
		<a class="active" href="#">1</a>
		<a href="#">2</a>
		<a href="#">3</a>
		<a href="#">4</a>
		<a href="#">5</a>
	</div>
</div>
              
            
!

CSS

              
                .slide-container { 
}
.slide-items { 
	position:relative; 
}
.slide-item { 
	transition:opacity 600ms ease; 
	background:#CCC;
	padding:35px;
}

/* this is the trick, position all the items whenever it’s not active yet */
.slide-item:not(.active) { 
	opacity:0; 
	pointer-events: none; 
	position:absolute; 
	top:0;
  width:100%;
}

.slide-nav {
	margin:10px 0;
}
.slide-nav a {
	border:1px solid #CCC;
	text-align: center;
	display: inline-block;
	padding:5px;
	width:30px;
	text-decoration: none;
}
.slide-nav a.active {
	font-weight:bold;
	background:#CCC;
}
              
            
!

JS

              
                jQuery(document).ready(function($){
	$('.slide-nav a').on('click',function(e){
		e.preventDefault();

		// this is so you could use the slider multiple times on the page
		$('.slide-item', $(this).parents('.slide-container') )
			.eq( $(this).index() )
			.addClass('active')
			.siblings()
			.removeClass('active');

		$(this).addClass('active').siblings().removeClass('active');
	})

});
              
            
!
999px

Console