Vì một tương lai người Do Thái!

Đăng ký thành viên của team front-end

Thursday, November 16, 2017

Slideshow jquery plugin

Slideshow jquery plugin


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<title>Slider Jquery</title>
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/font-awesome.css">

<script src="js/jquery-3.2.1.min.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div class="slideshow">
<ul class="slider">
<li>
<img src="img/1.jpg" alt="">
<section class="caption">
<h1>Lorem ipsum 1</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci quis ipsa, id quidem quisdem quisquam unde</p>
</section>
</li>

<li>
<img src="img/2.jpg" alt="">
<section class="caption">
<h1>Lorem ipsum 2</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur maiores debitis similique ut! Facilis molestias fugit, ex laudantium veniam consectetur incidunt voluptatem quasi aspernatur enim magni quibusdam eaque, ducimus quaerat!</p>
</section>
</li>

<li>
<img src="img/3.jpg" alt="">
<section class="caption">
<h1>Lorem ipsum 3</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur maiores debitis similique ut! Facilis molestias fugit, ex laudantium veniam consectetur incidunt voluptatem quasi aspernatur enim magni quibusdam eaque, ducimus quaerat!</p>
</section>
</li>

<li>
<img src="img/4.jpg" alt="">
<section class="caption">
<h1>Lorem ipsum 4</h1>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Consequatur maiores debitis similique ut! Facilis molestias fugit, ex laudantium veniam consectetur incidunt voluptatem quasi aspernatur enim magni quibusdam eaque, ducimus quaerat!</p>
</section>
</li>
</ul>
<ol class="pagination">
<li><span class="fa fa-circle"></span></li>
<li><span class="fa fa-circle"></span></li>
<li><span class="fa fa-circle"></span></li>
<li><span class="fa fa-circle"></span></li>
</ol>

<div class="left">
<span class="fa fa-chevron-left"></span>
</div>
<div class="right">
<span class="fa fa-chevron-right"></span>
</div>
</div>
</body>
</html>








*{
margin: 0;
padding:0;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
ul,ol{
list-style: none;
}
body{
font-family: Open sans;
}
img{
max-width: 100%;
}
.slideshow{
width: 100%;
position: relative;
}
.slider li, ul{
width: 100%;
}
.slider li img{
width: 100%;
}
.slider .caption{
position: absolute;
width: 100%;
height: 100%;
top:0;
left: 0;
padding: 15px 50px;

display: flex;
flex-direction: column;
justify-content: center;
align-items:center;

text-align: center;
color: #fff;
z-index:1;

}
.slider .caption h1{
font-size: 50px;
}
.slider .caption p{
font-size: 20px;
}
.pagination{
position: absolute;
top: 102%;
width: 100%;

display: flex;
justify-content: center;
}
.pagination li{
font-size: 20px;
margin: 2px 5px;
color: #858585;
}
.left, .right{
position: absolute;
top:0;
height: 100%;

display: flex;
align-items:center;

color:#fff;
font-size: 35px;

}
.left{
left: 10px;
}
.right{
right: 10px;
}





$(document).ready(function(){
$('.slider li').hide();
$('.slider li:first').show();
});









Bản Quyền || Cấm sao chép nội dung dưới mọi hình thức. Nếu muốn sao chép hãy để 5 phút đọc xong các chính sách của chúng tôi tại đây.
Tác giả: Minh Trung