<div class="slides">
<div class="slides">
<div class="slide">
<input type="radio" name="slideshow" id="slide1"><label for="slide1">CSS</label>
<div class="content">
<h2>CSS</h2>
<p>Maecenas faucibus mollis interdum. Sed posuere consectetur est at lobortis. Nulla vitae elit libero, a pharetra augue. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit.</p>
</div>
</div>
<div class="slide">
<input type="radio" name="slideshow" id="slide2"><label for="slide2">HTML</label>
<div class="content">
<h2>HTML</h2>
<p>Vestibulum id ligula porta felis euismod semper. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum.</p>
</div>
</div>
<div class="slide">
<input type="radio" name="slideshow" id="slide3"><label for="slide3">JQUERY</label>
<div class="content">
<h2>JQUERY</h2>
<p>Maecenas sed diam eget risus varius blandit sit amet non magna. Donec ullamcorper nulla non metus auctor fringilla. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean lacinia bibendum nulla sed consectetur. Morbi leo risus, porta ac consectetur ac, vestibulum at eros.</p>
</div>
</div>
<div class="slide">
<input type="radio" name="slideshow" id="slide4"><label for="slide4">JAVA SCRIPT</label>
<div class="content">
<h2>JAVA SCRIPT</h2>
<p>Donec ullamcorper nulla non metus auctor fringilla. Integer posuere erat a ante venenatis dapibus posuere velit aliquet. Aenean lacinia bibendum nulla sed consectetur.</p>
</div>
</div>
</div>
* {
* {
box-sizing: border-box;
}
.preload * {
transition: none !important;
}
body {
padding: 30px;
font-family: "Helvetica Neue", Helvetica, arial, sans-serif;
background: url('http://subtlepatterns.subtlepatterns.netdna-cdn.com/patterns/wild_oliva.png') #333;
line-height: 1.5;
}
h2 {
color: #fff;
margin-bottom: .5em;
font-size: 1.7em;
font-weight: bold;
text-shadow: 0 1px 0 rgba(0,0,0,1);
}
.slides {
position: relative;
width: 500px;
height: 250px;
overflow: hidden;
box-shadow: 0 0 10px rgba(0,0,0,.5);
border-radius: 5px;
background: #333;
border: 1px solid rgba(255,255,255,.1);
}
.slide {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
.content {
position: absolute;
width: 100%;
transform: translateX(-100%);
top: 0;
opacity: 0;
padding: 20px;
transition: transform .5s ease-out, opacity 1s ease-out;
}
.content p {
font-size: .85em;
color: #fff;
}
input[type=radio] {
display: none;
}
label {
display: block;
position: absolute;
bottom: 0;
line-height: 3em;
width: 25%;
text-align: center;
cursor: pointer;
font-size: .8em;
z-index: 50;
color: #fff;
text-shadow: 0 1px 0 rgba(0,0,0,.25);
font-weight: bold;
background: rgb(135,224,253); /* Old browsers */
background: linear-gradient(top, rgba(135,224,253,1) 0%, rgba(83,203,241,1) 40%, rgba(5,171,224,1) 100%); /* FF3.6+ */
background: gradient(linear, left top, left bottom, color-stop(0%,rgba(135,224,253,1)), color-stop(40%,rgba(83,203,241,1)), color-stop(100%,rgba(5,171,224,1))); /* Chrome,Safari4+ */
background: linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Chrome10+,Safari5.1+ */
background: linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* Opera 11.10+ */
background: linear-gradient(top, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* IE10+ */
background: linear-gradient(to bottom, rgba(135,224,253,1) 0%,rgba(83,203,241,1) 40%,rgba(5,171,224,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#87e0fd', endColorstr='#05abe0',GradientType=0 ); /* IE6-9 */
}
.slide:nth-child(2) label {
margin-left: 25%;
}
.slide:nth-child(3) label {
margin-left: 50%;
}
.slide:nth-child(4) label {
margin-left: 75%;
}
input[type=radio]:checked ~ .content {
transform: translateX(0);
opacity: 1;
}
input[type=radio]:checked + label {
background: #333;
color: #ccc;
text-shadow: none;
}
$(document).ready(function() {
$(document).ready(function() {
/* the Responsive menu script */
$('body').addClass('js');
var $menu = $('#menu'),
$menulink = $('.menu-link'),
$menuTrigger = $('.has-subnav > a');
$menulink.click(function(e) {
e.preventDefault();
$menulink.toggleClass('active');
$menu.toggleClass('active');
});
var add_toggle_links = function() {
if ($('.menu-link').is(":visible")){
if ($(".toggle-link").length > 0){
}/* js is only used to avoid transition on page load. Thanks to Chris Coyier for the tip.
http://css-tricks.com/transitions-only-after-page-load/
*/
jQuery(function($){
$('html').removeClass('preload');
})
else{
$('.has-subnav > a').before('<span class="toggle-link"> Open submenu </span>');
$('.toggle-link').click(function(e) {
var $this = $(this);
$this.toggleClass('active').siblings('ul').toggleClass('active');
});
}
}
else{
$('.toggle-link').empty();
}
}
add_toggle_links();
$(window).bind("resize", add_toggle_links);
});