Skip to main content

Menu dọc xổ xuống dạng thư mục

Hôm nay Karl sẽ giới thiệu cho các bạn một mẫu menu dọc đẹo dành cho việc thiết kế blog. Menu này có đặc điểm trượt từ trên xuống, hết hợp hiệu ứng hover khi dê chuột. Điểm khác biệt là menu sử dụng 2 button để ẩn hiện các sub menu. 







Và đây là hình demo:




☼ Cách tiến hành:
   1- Đăng nhập vào Blog
   2- Vào thiết kế (Mẫu)
   3- Chọn Chỉnh sửa HTML
4- Dán đoạn code sau vào trước thẻ đóng   ]]></b:skin>.
.button {border:1px solid #055;border-radius:3px;box-shadow:0 1px rgba(255,255,255,0.3) inset;background:#41A317;color:#FFFF00 !important;text-decoration:none !important}
a.button:hover,.submit.button:hover{border:1px solid #222;background:#810541}
.button.medium{padding:5px 10px;font-size:12px}
.button.big{padding:10px 20px;font-size:14px}
div.sdmenu {
width: 200px;
font-family: Arial, sans-serif;
font-size: 12px;
padding-bottom: 10px;
background: url(
https://lh4.googleusercontent.com/-qtqEgW9fYj4/UN7EwPuFpmI/AAAAAAAAAeI/ROau5P6Fm2k/s512/bottom-menu-doc-vinacer.gif) no-repeat right bottom;
color: #fff;
}
div.sdmenu div {
background: url(
https://lh5.googleusercontent.com/-0whgmbVe1R0/UN7EtsukdKI/AAAAAAAAAeA/K4Ged4d1kgg/s512/menu-vinacer-dot-blogspot-dot-com.gif) repeat-x;
overflow: hidden;
}
div.sdmenu div:first-child {
background: url(
https://lh5.googleusercontent.com/-0whgmbVe1R0/UN7EtsukdKI/AAAAAAAAAeA/K4Ged4d1kgg/s512/menu-vinacer-dot-blogspot-dot-com.gif) no-repeat;
}
div.sdmenu div.collapsed {
height: 30px;
}
div.sdmenu div span {
display: block;
padding: 8px 30px;
font-weight: bold;
color: white;
background: url(expanded.gif) no-repeat 10px center;
cursor: default;
border-bottom: 1px solid #ddd;
}
div.sdmenu div.collapsed span {
background-image: url(collapsed.gif);
}
div.sdmenu div a {
padding: 8px 30px;
background: #eee;
display: block;
border-bottom: 1px solid #ddd;
color: #066;
}
div.sdmenu div a.current {
background : #ccc;
}
div.sdmenu div a:hover {
background : #066 url(
https://lh5.googleusercontent.com/-0whgmbVe1R0/UN7EtsukdKI/AAAAAAAAAeA/K4Ged4d1kgg/s512/menu-vinacer-dot-blogspot-dot-com.gif) 0 -32px;
color: #fff;
text-decoration: none;
}

     5-  Bấm Lưu Mẫu  (save template) lại.

    6. Tạo một widget HTML/Javarscip và dán đoạn code sau vào:
<script type="text/javascript" src="http://code-pro.googlecode.com/files/sdmenu.js"></script>
<script type="text/javascript">
window.onload = function() {
myMenu = new SDMenu("my_menu");
myMenu.init();
};
</script>
<form action="#" style="font-family: sans-serif; font-size: .8em" onsubmit="return false">
<input class="submit button medium" type="button" value="
Hiện Menu" onclick="myMenu.expandAll()" />
<input class="submit button medium" type="button" value="
Rút gọn menu" onclick="myMenu.collapseAll()" />
</form>
<div style="float: left" id="my_menu" class="sdmenu">
<div>
<span>
Menu 1</span>
<a href="
#">Sub Menu 1.1</a>
<a href="
#">Sub Menu 1.2</a>
<a href="
#">Sub Menu 1.3</a>
<a href="
#">Sub Menu 1.4</a>
<a href="
#">Sub Menu 1.5</a>
</div>
<div>
<span>
Menu 2</span>
<a href="
#">Sub Menu 2.1</a>
<a href="
#">Sub Menu 2.2</a>
<a href="
#">Sub Menu 2.3</a>
<a href="
#">Sub Menu 2.4</a>
</div>
<div class="collapsed">
<span>
Menu 3</span>
<a href="
#">Sub Menu 3.1</a>
<a href="
#">Sub Menu 3.2</a>
<a href="
#">Sub Menu 3.3</a>
<a href="
#">Sub Menu 3.4</a>
<a href="
#">Sub Menu 3.5</a>
<a href="
#">Sub Menu 3.6</a>
</div>
<div>
<span>
Menu 4</span>
<a href="
#">Sub Menu 4.1</a>
<a href="
#">Sub Menu 4.2</a>
<a href="
#">Sub Menu 4.3</a>
<a href="
#">Sub Menu 4.4</a>
<a href="
#">Sub Menu 4.5</a>
</div>
</div>
Trong đo:
  • Thay các dấu thăng màu đỏ thành URL (địa chỉ) liên kết tới bài viết, nhãn, trang của bạn.
  • Thay các phần màu xanh thành tên của các bài viết, nhãn, trang của bạn/
  • Bạn hãy tải file sdmenu.js và Upload lên Google code hoặc Dropbox để sử dụng lâu dài.

   5-  Bấm Lưu   (save Widget) lại.

- Ở trên mình dùng file ảnh làm background bạn cũng có thể thay thành các hình ảnh của bạn. Nếu không muốn dùng ảnh bạn có thể xóa các file ảnh đó đi.
 Chúc thành công!

Comments

Popular posts from this blog

Leveraging the Fast TikTok API on Apify for Efficient Data Scraping

Introduction: In the world of social media data analysis, TikTok has emerged as a popular platform with a vast amount of user-generated content. To extract valuable insights from TikTok, developers and researchers often resort to web scraping. One efficient way to accomplish this task is by utilizing the Fast TikTok API on the Apify platform. In this article, we will explore the benefits and capabilities of leveraging the Fast TikTok API for data scraping on TikTok. Check the API here:  https://apify.com/novi/fast-tiktok-api

Giải trí với video hài

Hy vọng video này sẽ giúp mọi người thư giãn và xả xì trét :D

Tutorial: Scraping Data from TikTok using Fast TikTok API with Python

In this tutorial, I will guide you through the process of scraping data from TikTok using the Fast TikTok API with Python. We will be using the requests library to make HTTP requests and retrieve data from the API. Let's get started! Step 1: Obtain API Credentials Go to https://apify.com and create an account if you haven't already. Once logged in, navigate to the Fast TikTok API page ( https://apify.com/novi/fast-tiktok-api ). Follow the instructions on the page to obtain your API credentials, such as an API key or access token. Make sure to note down these credentials for future use. Step 2: Set up your Python Environment Ensure that you have Python installed on your system. You can download the latest version of Python from the official website ( https://www.python.org ). Install the requests library by running the following command in your terminal: pip install requests Step 3: Import Required Libraries Open your preferred Python IDE or text editor and create a new Python