Skip to content

Instantly share code, notes, and snippets.

@NigelRodgers
Forked from anonymous/index.html
Created April 8, 2017 20:52
Show Gist options
  • Save NigelRodgers/dfcd2eea98bf6b43f30e4ad41776b8a2 to your computer and use it in GitHub Desktop.
Save NigelRodgers/dfcd2eea98bf6b43f30e4ad41776b8a2 to your computer and use it in GitHub Desktop.
unslider
<div class="banner">
<ul>
<li style="background-image: url('http://unslider.com/img/sunset.jpg');">
<h1>The jQuery slider that just slides.</h1>
<p>No fancy effects or unnecessary markup, and it’s less than 3kb.</p>
<a class="btn" href="#download">Download</a>
</li>
<li style="background-image: url('http://unslider.com/img/wood.jpg');">
<h1>Fluid, flexible, fantastically minimal.</h1>
<p>Use any HTML in your slides, extend with CSS. You have full control.</p>
<a class="btn" href="#download">Download</a>
</li>
<li style="background-image: url('http://unslider.com/img/subway.jpg');">
<h1>Open-source.</h1>
<p>Everything to do with Unslider is hosted on GitHub.</p>
<a class="btn" href="//github.com/idiot/unslider">Contribute</a>
</li>
<li style="background-image: url('http://unslider.com/img/shop.jpg');">
<h1>Uh, that’s about it.</h1>
<p>I just wanted to show you another slide.</p>
<a class="btn" href="#download">Download</a>
</li>
</ul>
</div>
$(function() {
$('.banner').unslider({
speed: 500, // The speed to animate each slide (in milliseconds)
delay: 3000, // The delay between slide animations (in milliseconds)
complete: function() {}, // A function that gets called after every slide animation
keys: true, // Enable keyboard (left, right) arrow shortcuts
dots: true, // Display dot navigation
fluid: true // Support responsive design. May break non-responsive designs
});
});
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script src="http://unslider.com/unslider.min.js"></script>
* {
margin: 0;
padding: 0;
-webkit-font-smoothing: antialiased;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
::selection {
background: #bfa57c;
color: #fff;
}
body {
color: #a48d66;
font: 14px/23px proxima-nova-alt, "Proxima Nova Alt", sans-serif;
}
.banner
{
position:relative;
width:100%;
overflow:auto;
font-size:18px;
line-height:24px;
text-align:center;
color:rgba(255,255,255,.6);
text-shadow:0 0 1px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.3);
background:#5b4d3d;
box-shadow:0 1px 2px rgba(0,0,0,.25);
}
.banner ul
{
list-style:none;
width:300%;
}
.banner ul li
{
display:block;
float:left;
width:33%;
min-height:350px;
-moz-background-size:100% 100%;
-o-background-size:100% 100%;
-ms-background-size:100% 100%;
background-size: 100% 100%;
box-shadow:inset 0 -3px 6px rgba(0,0,0,.1);
padding:160px 0 110px;
}
.banner h1,.banner h2
{
font-size:40px;
line-height:52px;
color:#fff;
}
.banner .btn
{
display:inline-block;
clear:both;
color:#fff;
font-size:12px;
font-weight:700;
text-transform:uppercase;
text-decoration:none;
border:2px solid rgba(255,255,255,.4);
border-radius:5px;
margin:25px 0 0;
padding:9px 22px 7px;
}
.banner .btn:hover
{
background:rgba(255,255,255,.05);
}
.banner .btn:active
{
-webkit-filter:drop-shadow(0-1px2pxrgba(0,0,0,.5));
-moz-filter:drop-shadow(0-1px2pxrgba(0,0,0,.5));
-ms-filter:drop-shadow(0-1px2pxrgba(0,0,0,.5));
-o-filter:drop-shadow(0-1px2pxrgba(0,0,0,.5));
filter:drop-shadow(0-1px2pxrgba(0,0,0,.5));
}
.banner .btn,.banner .dot
{
-webkit-filter:drop-shadow(01px2pxrgba(0,0,0,.3));
-moz-filter:drop-shadow(01px2pxrgba(0,0,0,.3));
-ms-filter:drop-shadow(01px2pxrgba(0,0,0,.3));
-o-filter:drop-shadow(01px2pxrgba(0,0,0,.3));
filter:drop-shadow(01px2pxrgba(0,0,0,.3));
}
.banner .dots
{
position:absolute;
left:0;
right:0;
bottom:20px;
}
.banner .dots li
{
display:inline-block;
width:10px;
height:10px;
text-indent:-999em;
border:2px solid #fff;
border-radius:6px;
cursor:pointer;
opacity:.4;
-webkit-transition:background .5s, opacity .5s;
-moz-transition:background .5s, opacity .5s;
transition:background .5s, opacity .5s;
margin:0 4px;
}
.banner .dots li.active
{
background:#fff;
opacity:1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment