cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

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.

Quick-add: + add another resource

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.

Quick-add: + add another resource

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.

            
              <div id="slider-wrapper">
		<div id="dots">
			<ul>
				<li class="active"></li>
				<li></li>
				<li></li>
			</ul>
		</div>
		<div id="arrow-left" class="nav-arrow"></div>
		<div id="image-slider">
			<ul>
				<li class="active-img"><img src="http://www.derekhilldesign.com/projects/slider-header/images/sunset.jpg" alt="" /></li><li><img src="http://www.derekhilldesign.com/projects/slider-header/images/lele.jpg" alt="" /></li><li><img src="http://www.derekhilldesign.com/projects/slider-header/images/logo.jpg" alt="" /></li>
			</ul>
			<div id="nav-bar">
					<a href="#"><div><img src="http://www.derekhilldesign.com/projects/slider-header/images/thumb-web.jpg" /></div>Web</a><a href="#"><div><img src="http://www.derekhilldesign.com/projects/slider-header/images/thumb-print.jpg" /></div>Print</a><a href="#"><div><img src="http://www.derekhilldesign.com/projects/slider-header/images/thumb-logo.jpg" /></div>Logos</a><a href="#"><div><img src="http://www.derekhilldesign.com/projects/slider-header/images/thumb-photo.jpg" /></div>Photos</a>
			</div>
		</div>
		<div id="arrow-right" class="nav-arrow"></div>
	</div>
            
          
!
            
              @import url(https://fonts.googleapis.com/css?family=Questrial);
	
	body{
		padding: 0;
		margin: 0;
		background: #24282c;
		font-family: "Questrial", Arial, Helvetica, sans-serif;
	}
	
	#slider-wrapper{
		width: 1024px;
		height: auto;
		margin: 20px auto;
		text-align: center;
	}
	
	#dots{
		cursor: default;
	}
	
	ul{
		padding: 0;
		margin: 0;
	}
	
	#dots li{
		display: inline-block;
			*display: inline;
			zoom: 1.0;
		background: #61676D;
		width: 10px;
		height: 10px;
		border-radius: 8px;
		margin: 0 2px;
		cursor: pointer;
	}
	
	#dots li.active, #dots li:hover{
		background: #c4c9cf;
	}
	
	
	.nav-arrow{
		width: 46px;
		height: 343px;
		display: inline-block;
			*display: inline;
			zoom: 1.0;
		cursor: pointer;
	}
	
	#arrow-left{
		background: url(http://www.derekhilldesign.com/projects/slider-header/images/arrow-left.png) center center no-repeat;
	}
	
	#arrow-right{
		background: url(http://www.derekhilldesign.com/projects/slider-header/images/arrow-right.png) center center no-repeat;
	}
	
	#arrow-right:hover, #arrow-left:hover{
		background-color: #1e2225;
	}
	
	#image-slider{
		width: 923px;
		height: 343px;
		position: relative;
		margin-top: 10px;
		overflow: hidden;
		display: inline-block;
			*display: inline;
			zoom: 1.0;
	}
	
	#slider-wrapper:before{
		content: '';
		width: 974px;
		height: 52px;
		display: block;
		position: absolute;
		left: 50%;
		margin-left: -487px;
		top: 375px;
		background: url(http://www.derekhilldesign.com/projects/slider-header/images/shadow.png) center center no-repeat;
	}
	#image-slider ul{
		width: 923px;
		height: 343px;
		position: relative;
	}
	#image-slider ul li{
		display: inline-block;
			*display: inline;
			zoom: 1.0;
		position: absolute;
		top: 0;
		left: -923px;
	}
	
	#image-slider ul li.active-img{
		left: 0;
	}
	.next-img{
		z-index: 9999;
	}
	
	#nav-bar{
		width: 923px;
		position: absolute;
		z-index: 999999;
		bottom: -3px;
	}
	
	#nav-bar a{
		display: inline-block;
			*display: block;
			zoom: 1.0;
		width: 231px;
		text-align: center;
		height: 26px;
		padding-top: 9px;
		color: #fff;
		overflow: hidden;
		font-size: 21px;
		text-shadow: 0 1px 5px #000;
		text-decoration: none;
		position: relative;
		background: rgba(2, 19, 32, 0.9);
		-webkit-transition: padding-top .25s;
		-moz-transition: padding-top .25s;
		transition: padding-top .25s;
	}
	
	#nav-bar a:first-child{
		width: 230px;
	}
	
	#nav-bar a div{
		height: 0;
		width: 231px;
		overflow: hidden;
		position: absolute;
		left: 0;
		bottom: 0;
	}
	
	#nav-bar a div img{
		position: absolute;
		left: 0;
		bottom: 0;
		opacity: 0.3;
	}
	
	#nav-bar a:hover{
		padding-top: 317px;
		box-shadow: 0 0 5px #000;
	}
	
	#nav-bar a:hover div{
		height: 343px;
	}
            
          
!
            
              $(function(){
		
		var sliderInterval = setInterval(function() {
     		nextImg();
		}, 7000);
		
		$('.nav-arrow').click(function(){
			if($(this).attr('id') == 'arrow-left'){
				prevImg();
			}else{
				nextImg();
			}
			
			clearInterval(sliderInterval);
			
		});
		
		$('#dots li').click(function(){
			var thisIndex = $(this).index()
			
			if(thisIndex < $('#dots li.active').index()){
				prevDot(thisIndex);
			}else if(thisIndex > $('#dots li.active').index()){
				nextDot(thisIndex);
			}
			
			$('#dots li.active').removeClass('active');
			$(this).addClass('active');
			
			clearInterval(sliderInterval);
			
		});
	})
	
	function prevImg(){
		var curIndex = $('#image-slider li.active-img').index();
		
		if(curIndex == 0){
			$('#image-slider li:last-child').addClass('next-img').animate({
				left: 0
			}, function(){
				$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
				$('#image-slider li.next-img').attr('class', 'active-img');
				
				var nextIndex = $('#image-slider li.active-img').index();
				
				$('#dots li.active').removeClass('active');
				$('#dots li').eq(nextIndex).addClass('active');
			});
		}else{
			$('#image-slider li.active-img').prev().addClass('next-img').animate({
				left: 0
			}, function(){
				$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
				$('#image-slider li.next-img').attr('class', 'active-img');
				
				var nextIndex = $('#image-slider li.active-img').index();
				
				$('#dots li.active').removeClass('active');
				$('#dots li').eq(nextIndex).addClass('active');
			});
		}
	}
	
	function nextImg(){
		var curIndex = $('#image-slider li.active-img').index();
		
		if(curIndex == $('#image-slider li').length - 1){
			$('#image-slider li:first-child').addClass('next-img').css('left', 923).animate({
				left: 0
			}, function(){
				$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
				$('#image-slider li.next-img').attr('class', 'active-img');
				
				var nextIndex = $('#image-slider li.active-img').index();
				
				$('#dots li.active').removeClass('active');
				$('#dots li').eq(nextIndex).addClass('active');
			});
		}else{
			$('#image-slider li.active-img').next().addClass('next-img').css('left', 923).animate({
				left: 0
			}, function(){
				$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
				$('#image-slider li.next-img').attr('class', 'active-img');
				
				var nextIndex = $('#image-slider li.active-img').index();
				
				$('#dots li.active').removeClass('active');
				$('#dots li').eq(nextIndex).addClass('active');
			});
		}
	}
	
	function prevDot(newIndex){
		$('#image-slider li').eq(newIndex).addClass('next-img').animate({
			left: 0
		}, function(){
			$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
			$('#image-slider li.next-img').attr('class', 'active-img');
		});
	}
	
	function nextDot(newIndex){
		$('#image-slider li').eq(newIndex).addClass('next-img').css('left', 923).animate({
			left: 0
		}, function(){
			$('#image-slider li.active-img').removeClass('active-img').css('left', '-923px');
			$('#image-slider li.next-img').attr('class', 'active-img');
		});
	}
            
          
!
999px
Loading ..................

Console