Kiểu trình chiếu phiên bản s3Slider sử dụng jQuery
Chủ Nhật, 17 tháng 10, 2010
s3Slider jQuery plugin được thực hiện theo ý tưởng script slideshow mượt và được phát triển bởi lập trình viên Boban Karišik tại Serbia.
Bạn có thể xem trình chiếu demo tại trang web này: kruskica.net.
Sử dụng plugin này rất dễ dàng. Trước tiên là kèm vào thư viện jQuery rồi thêm vào javascript s3Slider ở phần <head> của trang web.
<script src="js/jquery.js" type="text/javascript"></script>
<script src="js/s3Slider.js" type="text/javascript"></script>
Bạn có thể hạ tải file js/jquery.js và js/s3Slider.js.
Kế đến cần thiết lập HTML cho trang trình chiếu.
<div id="s3slider">
<ul id="s3sliderContent">
<li class="s3sliderImage">
<img src="#" />
<span>Your text comes here</span>
</li>
<li class="s3sliderImage">
<img src="#" />
<span>Your text comes here</span>
</li>
<div class="clear s3sliderImage"></div>
</ul>
</div>
Sau nữa là phải tạo các khai báo CSS:
#s3slider {
width: 400px; /* important to be same as image width */
height: 300px; /* important to be same as image height */
position: relative; /* important */
overflow: hidden; /* important */
}
#s3sliderContent {
width: 400px; /* important to be same as image width or wider */
position: absolute; /* important */
top: 0; /* important */
margin-left: 0; /* important */
}
.s3sliderImage {
float: left; /* important */
position: relative; /* important */
display: none; /* important */
}
.s3sliderImage span {
position: absolute; /* important */
left: 0;
font: 10px/15px Arial, Helvetica, sans-serif;
padding: 10px 13px;
width: 374px;
background-color: #000;
filter: alpha(opacity=70); /* here you can set the opacity of box with text */
-moz-opacity: 0.7; /* here you can set the opacity of box with text */
-khtml-opacity: 0.7; /* here you can set the opacity of box with text */
opacity: 0.7; /* here you can set the opacity of box with text */
color: #fff;
display: none; /* important */
top: 0;
/*
if you put
top: 0; -> the box with text will be shown at the top of the image
if you put
bottom: 0; -> the box with text will be shown at the bottom of the image
*/
}
.clear {
clear: both;
}
Nếu hiểu về CSS thì bạn có thể điều chỉnh các thuộc tính và giá trị cho phù hợp với trang web của mình.
Cuối cùng bạn cần phải thiết lập thời gian bao lâu để một bức hình được chiếu lên trang.
$(document).ready(function() {
$('#s3slider').s3Slider({
timeOut: 4000
});
});
Như vậy toàn bộ phần chức năng hiệu ứng slider được đặt như sau:
<head>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/s3Slider.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#s3slider').s3Slider({
timeOut: 4000
});
});
</script>
</head>
Hy vọng rằng bạn sẽ hài lòng với kiểu trình chiếu này.
Tăng cỡ chữ
Mặc định
Giảm cỡ chữ
Liên hệ mail: tpm1512@yahoo.com và xem tất cả bài viết trang này
Tại đây
Nhấn vào theo dõi thăm trang web của Trần Phúc Minh
-
https://yogaso1.blogspot.com/2010/10/kieu-trinh-chieu-phien-ban-s3slider-su.html
Minh cám ơn bạn đã quan tâm và rất vui vì bài viết đã đem lại thông tin hữu ích cho bạn.
MENU
Sản phẩm
Trang chủ
Nổi bậc
Tiện ích
Tài khoản
Tác vụ
YOUTUBE
Trang chủ
Lên trên
Tổng số Bình luận [ 0]
Đăng nhận xét