Thứ Tư, 8 tháng 8, 2012

SlideTab Recent posts chuyển động ngang


Các bước thực hiện:
- Vào code template (thiết kế -> chỉnh sửa code HTML), và chèn đoạn mã code bên dưới vào trước thẻ đóng </head>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script>
- Nếu trong code template của bạn đã có file jquery.min.js thì không cần chèn vào nữa.
- Tiếp theo, tạo 1 widget HTML/javascript và chèn đoạn code bên dưới :

<div align="left">
<style type="text/css">
#slidearea {
height: 242px;
overflow: hidden;
margin: 0px 00px 0 0px;
position: relative;
width: 948px;
background: url( https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvWppzodW6w56Vl9xholtYGE4H3EfH_fXKjSEwhUpU27hR_pxRKL6PJcQZ1L1dbiRYkkRJqOLuF2vPN4JGsHQaNbU9vqVBmUiHTQvgwb3A05eSPhk_OCOB_eOYd7ENsLwyYsmuD5x2WCxS/s0/slider.png) no-repeat;
}
#gallerycover {
overflow: hidden;
margin: 15px 24px 0 24px;
width: 900px;
}
.mygallery {
overflow: hidden;
visibility: visible;
position: relative; z-index: 2;
left: 0px;
width: 900px;
}
.mygallery ul {
margin:0;
padding:0;
position: relative;
list-style-type: none;
z-index: 1;
width: 2700px;
left: -1620px;
}
.mygallery ul li {
overflow: hidden;
float: right;
width: 180px;
height: 210px;
}
.mytext {
position: relative;
margin: 0 5px 0 5px;
width: 170px;
height: 210px;
display: inline;
float: left;
color: #C4C4C4;
}
.mytext p {
padding: 0 0;
color: #555;
font-size: 12px;
line-height: 20px;
width: 170px;
text-shadow: 1px 1px 0 #F6F6F6;
}
.mytext h2 {
padding: 5px 0;
color: black;
width: 170px;
font-size: 14px;
font-weight: bold;
}
.mytext h2 a:link, .mytext h2 a:visited {
color: black;
text-decoration: none;
outline: none;
}
.mytext h2 a:hover {color:#888;}
img.sidim {
width: 170px;
height: 100px;
}
.prevb {
float: left;
width: 15px;
height: 27px;
z-index: 200;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg0jekLBcYKK7zx4MD6DJcfmpiSZTNIdfh1iYK4vsXk0_siKqq_BXGUZ9vcyinkXK6VhOqDr8YAGa8iROiBmLXTrezUmd6UTQjvxYbmVbLDp6ICdLq9welAZsUUZx1pmYFty_GoTb0h0ebQ/s0/prev.png)!important;
position: absolute;
left: 5px;
bottom: 110px;
}
.nextb {
float: right;
width: 20px;
height: 35px;
z-index: 200;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHPfOCyxqDnBW31JYN84dxNr2_hE9QUb9ubt4OkzKXxZ_7yaoAArfveDf1vK8QhPToDL9hBCeMCgnqAwqY18rU1kchsCBzFSrpblriFR4N9-xavfYoUkvDFaEK-3-UaBqCTDW9SRb_QgA/s0/next.png)!important;
position: absolute;
right: 5px;
bottom: 110px;
display: block;
}
</style>

<script src="https://dl.dropbox.com/u/74775294/Filejs/slide-mygallery.js" type="text/javascript"></script>

<script stype="text/javascript">
var $jx = jQuery.noConflict();
$jx(function() {
$jx(".mygallery").jCarouselLite({
btnNext: ".nextb",
btnPrev: ".prevb",
visible: 5,
auto: 3000,
speed: 1000,
easing: "backout" 
});
});
</script>

<div id="slidearea">
<div id="gallerycover">
<div class="mygallery">
<ul>
<script type="text/javascript">
var mode = "all";
var g_numposts = 10;
var g_numcontents = 15;
var g_label="
Đặc sản Hà Nam";
var homepage="http://www.dvt.com.vn";
</script>

<script src="https://dl.dropbox.com/u/74775294/Filejs/feed-mygallery.js" type="text/javascript"></script>
</ul>

<div class="clear"></div>
</div>
</div>
<a class="prevb" href="#"></a>
<a class="nextb" href="#"></a>
</div>


Hướng dẫn tùy chỉnh :

visible: 5 đây là số bài viết sẽ được hiển thị ra ngoài.

auto: 3000 đây là thời gian chạy auto, 3000 tương ứng với 3 giây, tức là sau 3 giây tự động chuyển bài.

speed: 1000 là tốc độ chuyển bài viết khi click vào button left hoặc right (mũi tên màu cam)

Lưu ý : nếu không muốn chạy auto, thì bạn bỏ dòng auto: 3000, trong đoạn code javascript, tức là đoạn script ở trên chỉ còn như bên dưới :

<script stype="text/javascript">
var $jx = jQuery.noConflict();
$jx(function() {
$jx(".mygallery").jCarouselLite({
btnNext: ".nextb",
btnPrev: ".prevb",
visible: 5,
speed: 1000,
easing: "backout"
});
});
</script>
var mode = "all"; là chế độ hiển thị theo cả blog hoặc theo 1 nhãn nào đó, nếu giá trị là all thì hiển thị các bài viết mới của blog, nếu giá giá trị là single thì sẽ hiển thị bài viết theo nhãn được chọn (là biến g_label bên dưới)
var g_numposts = 10; là số bài viết sẽ load (lưu ý là số bài viết sẽ load (g_numposts) khác với số bài viết sẽ được hiển thị (visible: {giá trị thiết lập}) )
var g_numcontents = 15; số chữ (là các chuỗi ngăn cách bằng dấu khoảng trắng) sẽ được hiển thị ở đoạn mô tả bài viết.
var g_label="
Đặc sản Hà Nam"; tên nhãn sẽ được chọn nếu hiển thị ở chế độ mode = "single";
var homepage="http://www.dvt.com.vn"; thay http://www.dvt.com.vn thành tên domain (
domain.blogspot.com) của blog bạn.
Sưu tầm Internet

Không có nhận xét nào:

Đăng nhận xét