Showing posts with label Menu. Show all posts
Showing posts with label Menu. Show all posts

Sunday, January 23, 2011

Tạo menu ngang trên phần Header

Các Tempplate cơ bản của Blogger thường không có thanh menu ngang trên phần Header. Một kiểu menu như vậy giúp bạn có thêm không gian web để bố trí các liên kết cần thiết cho blog.

Để tạo kiểu menu này, bạn hãy thực hiện như sau.

Bước 1. Đăng nhập Blogger, vào Design >> Edit HTML. Đặt đoạn code CSS sau đây vào trước dòng ]]</b:skin>.

/* ----- LINKBAR ----- */
#linkbar {
margin: 6px 0px 0px 0px;
padding: 0px 0px 0px 0px;
width: 100%;
position: relative;
background: #000;
border: 1px solid #000;
border-bottom: 0;
}
#linkbar ul {
margin: 0px 0px 0px 0px;
padding: 5px 5px 7px 5px;
text-align: left;
list-style-type:none;
}
#linkbar li {
display: inline;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
}
#linkbar h2 {
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
display: none;
visibility: hidden;
}
#linkbar a {
clear: both;
margin: 0px -4px 0px 0px;
padding: 3px 20px 3px 20px;
width:100%;
text-decoration:none;
font-family: arial, sans-serif;
font-weight: bold;
font-size: 12px;
color: #fff;
border-right: 1px solid #fff;
}
#linkbar a:hover {
color: #000;
background: #fff;
}

Bước 2. Tìm dòng <div id='header-wrapper'> và đặt trước nó với đoạn code bên dưới. (Đối với Template Simple sẵn có của Blogger hiện nay thì đặt trước thẻ <header>).

<div id='linkbar-wrapper'>
<b:section class='linkbar' id='linkbar' showaddelement='no'>
<b:widget id='LinkList1' locked='true' title='Linkbar' type='LinkList'>
<b:includable id='main'>
<b:if cond='data:title'><h2><data:title/></h2></b:if>
<div class='widget-content'>
<ul>
<b:loop values='data:links' var='link'>
<li><a expr:href='data:link.target'><data:link.name/></a></li>
</b:loop>
</ul>
</div>
</b:includable>
</b:widget>
</b:section>
</div>

Lưu Template.

Bước 3. Vào Page Elements. Bạn sẽ nhìn thấy trên đỉnh Template có một tiện ích tên là Linkbar nằm trên phần Header, nhấn vào nút Edit. Tại cửa sổ mới, bạn lần lượt thêm các URL và tên cho các liên kết.

Wednesday, January 5, 2011

Tạo menu dạng thư mục với DD Tree Menu Script

Menu dạng cây thư mục là một kiểu menu cổ điển. Menu dạng cây thư mục có thể được thiết kế bằng phần mềm Flash Menu. Tuy nhiên quá trình thực hiện khá phức tạp.

Với sự hỗ trợ của Tree Menu Script do Dynamic Drive phát triển, kiểu menu này biến bất kỳ một danh mục liên kết UL thành một cây thư mục có thể thu hẹp hoặc mở rộng.

DEMO

Để thực hiện kiểu Menu này, bạn hãy xem Demo, sau đó cài đặt theo các bước sau đây:

Bước 1. Đặt đoạn code sau đây vào trước thẻ </head>.

<script type="text/javascript" src="http://yourjavascript.com/12503401210/simpletreemenu.js">

/***********************************************
* Simple Tree Menu- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/
</script>

Bước 2. Đặt đoạn code sau đây vào trước thẻ </head>, ngay sau code ở Bước 1.

<style type="text/css">
.treeview ul{ /*CSS for Simple Tree Menu*/
margin: 0;
padding: 0;
}
.treeview li{ /*Style for LI elements in general (excludes an LI that contains sub lists)*/
background: white url(http://1.bp.blogspot.com/-OdYhoveUcos/Touqd0ida_I/AAAAAAAAAHE/eSVxZI-Cazw/s1600/list.gif) no-repeat left center;
list-style-type: none;
padding-left: 22px;
margin-bottom: 3px;
}
.treeview li.submenu{ /* Style for LI that contains sub lists (other ULs). */
background: white url(http://2.bp.blogspot.com/-LnJAynSwZco/TouqdpTkwUI/AAAAAAAAAHA/MAFR9KoHev0/s1600/closed.gif) no-repeat left 1px;
cursor: hand !important;
cursor: pointer !important;
}
.treeview li.submenu ul{ /*Style for ULs that are children of LIs (submenu) */
display: none; /*Hide them by default. Don't delete. */
}
.treeview .submenu ul li{ /*Style for LIs of ULs that are children of LIs (submenu) */
cursor: default;
}
</style>

Bước 3. Trong phần thân trang web, sau thẻ <body>, thiết lập cấu trúc HTML như sau.

<a href="javascript:ddtreemenu.flatten('treemenu1', 'expand')">Mở rộng</a> | <a href="javascript:ddtreemenu.flatten('treemenu1', 'contact')">Thu hẹp</a>

<ul id="treemenu1" class="treeview">
<li>Folder 1
<ul>
<li><a href="#">Sub Item 1.1</a></li>
<li><a href="#">Sub Item 1.2</a></li>
</ul>
</li>
<li>Folder 2
<ul>
<li><a href="#">Sub Item 2.1</a></li>
<li><a href="#">Sub Item 2.2</a></li>
<li><a href="#">Sub Item 2.3</a></li>
<li><a href="#">Sub Item 2.4</a></li>
</ul>
</li>
<li>Folder 3
<ul>
<li>Sub Item 3.1</li>
<li>Folder 3.1
<ul rel="open">
<li>Sub Item 3.1.1</li>
<li>Sub Item 3.1.2</li>
<li>Folder 3.1.1
<ul>
<li>Sub item 3.1.1.1</li>
<li>Sub item 3.1.1.2</li>
<li>Sub item 3.1.1.3</li>
<li>Sub item 3.1.1.4</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>

<li>Item 4</li>
</ul>

<script type="text/javascript">
ddtreemenu.createTree("treemenu1", true) // nếu bạn muốn khi load trang, menu ở dạng thu gọn thì thay TRUE thành FALSE
</script>

Chú ý trong đoạn code trên, thuộc tính rel="open" có chức năng xác định các sublist được mở rộng mặc định khi load trang web.

Kiểu menu này có thể cài đặt cho Blogger khá dễ dàng tương tự cách cài đặt đối với website thông thường ở trên.

Bạn có thể xem thêm ở trang giới thiệu của Dynamic Drive.

Tạo kiểu menu đẹp với DD Tabe Menu Script

Mình làm việc trong lĩnh vực tài chính nên thường xuyên đọc tin tức trên trang Stockbiz.vn. Và mình lại thích webdesign nên từ lâu đã nghía đến kiểu menu đẹp tại trang này. Vì thế hy vọng một ngày nào đó sẽ giới thiệu cho bạn đọc cách tạo kiểu menu như vậy. Khi tìm hiểu ngọn nguồn mới biết đó là DD Tab Menu do Dynamic Drive phát triển. Bạn có thể xem trang Demo của Dynamic Drive ở đây.

Qua quá trình nguyên cứu mình đã chỉnh code từ Menu của trang Stockbiz.vn cho gọn gàng hơn, chuyên nghiệp hơn và đặc biệt là dễ cài đặt đối với người chưa biết nhiều về webdesign. Bạn có thể xem Demo của mình ở đây.

Sau đây là các bước thực hiện.

Bước 1. Đặt đoạn code dưới đây vào trước thẻ </head>.

<script src="http://hacodeproject.googlecode.com/files/ddtabmenu.js" type="text/javascript"></script>
<script type="text/javascript">
//SYNTAX: ddtabmenu.definemenu("tab_menu_id", integer OR "auto")
ddtabmenu.definemenu("ddtabs", 0) //initialize Tab Menu with ID "ddtabs1" and select 1st tab by default
</script>

<style type="text/css">
.basictab{float:left;line-height:normal;/*border-bottom:1px solid #7e9fff;Add border strip to bottom of menu*/}
.basictab ul{list-style-type:none;margin:0;margin-left:5px;/*Left offset of entire tab menu relative to page*/padding:0}
.basictab li{display:inline;margin:0;padding:0}
.basictab a{float:left;background:url(http://bit.ly/hGffu7) no-repeat left top;margin:0;margin-right:5px;/*spacing between each tab*/padding:0 0 0 9px;text-decoration:none}
.basictab a span{float:left;display:block;background:url(http://img411.imageshack.us/img411/421/glowtab.gif) no-repeat right top;padding:5px 12px 3px 3px;font-weight:bold;color:#3B3B3B}
/* Commented Backslash Hack hides rule from IE5-Mac \*/
.basictab a span{float:none}
/* End IE5-Mac hack */
.basictab a:hover span{color:White}
.basictab a.current{/*Selected Tab style*/background-position:0 -82px;/*Shift background image up to start of 2nd tab image*/}
.basictab a.current span{/*Selected Tab style*/background-position:100% -82px;/*Shift background image up to start of 2nd tab image*/color:White}
.basictab a:hover{/*onMouseover style*/background-position:0% -82px;/*Shift background image up to start of 2nd tab image*/text-decoration:none}
.basictab a:hover span{/*onMouseover style*/background-position:100% -82px;/*Shift background image up to start of 2nd tab image*/}
.tabcontainer{clear:left;width:998px;/*width of 2nd level sub menus*/height:1.5em;/*height of 2nd level sub menus. Set to largest's sub menu's height to avoid jittering.*/background:#035EB7;height:30px;font-size:11px}
.tabcontent{display:none;color:White;padding-top:5px;padding-left:13px;float:left}
.tabcontent a{color:White;font-size:12px;padding:4px 7px 0 7px;text-decoration:none}

.haSearch{float:right;font-weight:bold;padding-right:5px;padding-top:4px}
.haSearchInput{-moz-background-clip:border;-moz-background-inline-policy:continuous;-moz-background-origin:padding;height:16px;padding:3px;text-align:left;width:200px;font-size:11px;background-color:White}
.haSearchTextBox{border:0 none;float:left;font-size:11px;height:14px;left:24px;width:100px}
.btn{height:15px;width:15px;border-width:0;float:right}
</style>

Trong đoạn code CSS ở trên, bạn cần điều chỉnh tham số width:998px cho phù hợp với chiều rộng phần main của trang web.

Bước 2. Thiết lập cấu trúc HTML như dưới đây và đặt trong phần thân trang web, giữa 2 thẻ <body>, </body>.

<div id="ddtabs" class="basictab">
<ul>
<li><a href='#' rel='sc1'><span>Trang chủ</span></a></li>
<li><a href='#' rel='sc2'><span>Menu I</span></a></li>
<li><a href='#' rel='sc3'><span>Menu II</span></a></li>
<li><a href='#' rel='sc4'><span>Menu III</span></a></li>
<li><a href='#' rel='sc5'><span>Menu IV</span></a></li>
<li><a href='#' rel='sc6'><span>Menu V</span></a></li>
</ul>
</div>

<div class="tabcontainer">

<div id='sc1' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Giới thiệu </a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href='#'>Liên hệ</a></div>

<div id='sc2' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Submenu I.1</a> |
<a href='#'>Submenu I.2</a> |
<a href='#'>Submenu I.3</a> |
<a href='#'>Submenu I.4</a> |
<a href='#'>Submenu I.5</a> |
<a href='#'>Submenu I.6</a> |
<a href='#'>Submenu I.7</a></div>

<div id='sc3' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Submenu II.1</a> |
<a href='#'>Submenu II.2</a> |
<a href='#'>Submenu II.3</a> |
<a href='#'>Submenu II.4</a> |
<a href='#'>Submenu II.5</a> |
<a href='#'>Submenu II.6</a> |
<a href='#'>Submenu II.7</a></div>

<div id='sc4' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Submenu III.1</a> |
<a href='#'>Submenu III.2</a> |
<a href='#'>Submenu III.3</a> |
<a href='#'>Submenu III.4</a> |
<a href='#'>Submenu III.5</a> |
<a href='#'>Submenu III.6</a> |
<a href='#'>Submenu III.7</a></div>

<div id='sc5' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Submenu IV.1</a> |
<a href='#'>Submenu IV.2</a> |
<a href='#'>Submenu IV.3</a> |
<a href='#'>Submenu IV.4</a> |
<a href='#'>Submenu IV.5</a> |
<a href='#'>Submenu IV.6</a> |
<a href='#'>Submenu IV.7</a></div>

<div id='sc6' class='tabcontent'><a style ='color :#CCCCCC; font-size:12px;' href='/rss.xml'>RSS&nbsp;<img src='http://bit.ly/hjpshO' /></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<a href='#'>Submenu V.1</a> |
<a href='#'>Submenu V.2</a> |
<a href='#'>Submenu V.3</a> |
<a href='#'>Submenu V.4</a> |
<a href='#'>Submenu V.5</a> |
<a href='#'>Submenu V.6</a> |
<a href='#'>Submenu V.7</a></div>

<div class="haSearch">
<div class="haSearchInput">
<form action='http://www.google.com/custom' id='searchform' method='get' style='display:inline;'>
<input type="hidden" name="sitesearch" value="huynh-nhat-ha.blogspot.com" />
<input class="haSearchTextBox" name='q' onblur='if (this.value == "") {this.value = "Nhập từ cần tìm...";}' onfocus='if (this.value == "Nhập từ cần tìm...") {this.value = ""}' type='text' value='Nhập từ cần tìm...'/>
<input class='btn' name='' src='http://bit.ly/hSgufo' type='image' value='Go'/>
</form>
</div>
</div>

</div>

Trong cấu trúc HTML ở trên, bạn cần đặt tên Menu, Submenu và URL (thay vào vị trí các dấu #) tương ứng.

Kiểu menu này có thể cài đặt cho Blogger dễ dàng tương tự như cách cài đặt đối với website thông thường.

Monday, November 22, 2010

Tạo thanh menu động sử dụng jQuery

Thư viện jQuery có thể giúp ích nhiều trong việc tạo ra các thanh menu cho trang web. Dưới đây là một kiểu menubar có sử dụng thư viện jQuery.

Xem Demo.

Để tạo được thanh menu như thế này, bạn thực hiện theo các bước sau đây.

1. Đặt phần code CSS và Javascript sau đây vào trước thẻ </head>
<style type='text/css'>
ul#topnav {
margin: 0px 0px;
padding: 0px;
list-style: none;
font-size: 1.1em;
clear: both;
float: left;
width: 620px;
}
ul#topnav li{
margin: 0;
padding: 0;
overflow: hidden;
float: left;
height:40px;
}
ul#topnav a, ul#topnav span {
padding: 10px 28px;
float: left;
text-decoration: none;
color: green;
clear: both;
height: 20px;
line-height: 20px;
background: #1d1d1d;
}
ul#topnav a { color: green; }
ul#topnav span { display: none;}
ul#topnav.v2 span{
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA2MH7OTqYTKh28edPQVIcXV-w_FlNt04jwFTTbEkZOumm_6zdWW54mlmJqm3q_7jgqzGU_SIH3Dl3Kz_GF4UU69KiB4sqoqiHFDCnVLt4FTxjvkDgV-goHUQe9562tZH0a5DffkhkF7NA/s1600/vivaverdemenu.png) repeat-x left top;}
ul#topnav.v2 a{ color: #fff;
background: url(https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhA2MH7OTqYTKh28edPQVIcXV-w_FlNt04jwFTTbEkZOumm_6zdWW54mlmJqm3q_7jgqzGU_SIH3Dl3Kz_GF4UU69KiB4sqoqiHFDCnVLt4FTxjvkDgV-goHUQe9562tZH0a5DffkhkF7NA/s1600/vivaverdemenu.png) repeat-x left bottom;
}
</style>

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js' type='text/javascript'></script>
<script type='text/javascript'>
$(document).ready(function() {
$("#topnav li").prepend("<span></span>"); //Throws an empty span tag right before the a tag

$("#topnav li").each(function() { //For each list item...
var linkText = $(this).find("a").html(); //Find the text inside of the a tag
$(this).find("span").show().html(linkText); //Add the text in the span tag
});

$("#topnav li").hover(function() { //On hover...
$(this).find("span").stop().animate({
marginTop: "-40" //Find the span tag and move it up 40 pixels
}, 250);
} , function() { //On hover out...
$(this).find("span").stop().animate({
marginTop: "0" //Move the span back to its original state (0px)
}, 250);
});

});
</script>
Những phần được đánh dấu màu đỏ là chỗ bạn có thể điều chỉnh cho phù hợp với ý thích của mình.

2. Thiết lập cấu trúc HTML như bên dưới và đặt vào giữa 2 thẻ <body>, </body>.
<ul class='v2' id='topnav'>
<li><a href='http://yourblog.blogspot.com'>Home</a></li>
<li><a href='/gioi-thieu.html'>Giới thiệu</a></li>
<li><a href='/quy-dinh.html'>Quy định</a></li>
<li><a href='/lien-he.html'>Liên hệ</a></li>
<li><a href='/dien-dan.html'>Diễn đàn</a></li>
<li><a href='/lien-ket.html'>Liên kết</a></li>
</ul>
Bạn cần thay đổi những phần được đánh dấu màu xanh theo các liên kết tương ứng.

Sunday, October 17, 2010

Tạo thanh sidebar menu với trạng thái viếng thăm kiểu đánh dấu tick

Có nhiều cách khác nhau để thể hiện sự đặc sắc và nổi bật cho thanh menu sidebar trên website của bạn. Một trong số đó là sidebar với trạng thái liên kết đã viết thăm dạng tick, tức là kiểu đánh dấu tick giống như khi bạn làm bài kiểm tra vậy. Đây cũng là một trong những kiểu menu rất độc đáo, chỉ cần vài thao tác CSS đơn giản là có thể thực hiện kiểu menu sidebar thật tuyệt vời.

Sau đây là đoạn mã cho phần CSS.

#sidebar ul {
list-style-type:none;
padding:3px;
}

#sidebar li a {
display:block;
line-height:150%;
width:239px;
background:url(ticks_grey.gif);
text-decoration:none;
}

#sidebar li a:link, a:active {
color:#666;
}

#sidebar li a:hover {
color:#F33;
background-position: 0 -20px;
}

#sidebar li a:visited {
background-position: 0 -40px;
}

Tải file hình ticks_grey tại đây.

Chú ý: Kiểu sidebar này có thể áp dụng khi thiết kế blog trên Blogger. Bạn chỉ việc dán đoạn mã CSS trên vào trước phần ]]></b:skin> khi chỉnh sửa HTML trong Template.

Tạo Menu sổ dọc cơ bản sử dụng Javascript

Kiểu Menu sổ dọc là một cách tuyệt vời để gom nhiều liên kết vào một vùng nhỏ.

Bài viết này sẽ hướng dẫn bạn cách tạo một thanh menu sổ dọc cơ bản nhưng cũng rất hữu ích khi thiết kế web.

Xem Demo.

Bước 1: Đặt code Javascript dưới đây vào phần đầu (trước thẻ </head>) của trang web.

<script language="javascript"><!--
function openURL()
{

// grab index number of the selected option
selInd = document.theForm.aaa.selectedIndex;

// get value of the selected option
goURL = document.theForm.aaa.options[selInd].value;

// redirect browser to the grabbed value (here a URL)
top.location.href = goURL;

}

//-->
</script>

Bước 2: Thiết lập HTML để hiển thị Menu sổ dọc, như ví dụ bên dưới.

<form name="theForm"> <tt>
<select name="aaa" size="1">
<option selected value="/trang-chu.html">Home </option>
<option value="#">-------------------- </option>
<option value="/introduction.html">Introduction </option>
<option value="/service.html">Services </option>
<option value="#">-------------------- </option>
<option value="/products.html">Products </option>
<option value="/download.html">Download </option>
<option value="/resources.html">Resources </option>
<option value="#">-------------------- </option>
<option value="/contact.html">Contact </option>
<option value="/faq.html">FAQ </option>
</select>
<input type="button" value=" GO " onClick="openURL()"> </tt>
</form>

Nếu bạn không cần sử dụng nút GO thì bỏ dòng code của nó, tức là dòng trước thẻ </form>. Sau đó bạn phải thay đổi dòng thứ hai thành thế này:

<select name="aaa" size="1" onchange="openurl()">

Tạo thanh menu dọc với hiệu ứng accordion sử dụng Mootools

Hiệu ứng accordion giúp một vùng liên kết được kích chuột vào có thể xếp lại trông giống như đàn accordion. Sử dụng hiệu ứng này với sự hỗ trợ của Mootools có thể tạo một thanh menu dọc khá ấn tượng.

Xem Demo.

Sau đây là hướng dẫn cài đặt hiệu ứng:

Bước 1: Trước tiên, bạn hãy đặt toàn bộ phần code bên dưới vào phần đầu của trang HTML, nằm giữa 2 thẻ <head>, </head>.
<script type="text/javascript" src="http://www.ryanscherf.net/demos/accordion/mootools.js"></script>
<style type="text/css">
#content {
width: 220px;
margin: 0 auto;
}

#wrap {
width: 232px;
overflow: hidden;
background: #fff url("http://www.ryanscherf.net/demos/accordion/images/wrapbg.gif") repeat-y top left;
}

h3 {
padding: 10px 0 11px 15px;
margin: 0;
font-size: 12px;
font-weight: normal;
color: #222;
background: #efefef;
cursor: pointer;
border-bottom: 1px solid #fff;
text-decoration: none;
}

h3.toggler a {
color: #666;
text-decoration: none;
}

h3.toggler a:hover {
color: black;
}

div.accordion {
background: #fff url("http://www.ryanscherf.net/demos/accordion/images/accordionbg.gif") repeat-x top left;
}

div.accordion ul {
list-style-type: none;
padding: 0;
margin: 0 0 5px 0;
}

div.accordion ul li {
padding: 6px 0;
}

div.accordion ul li a {
color: #666;
text-decoration: none;
display: block;
padding: 4px 0px 4px 20px;
font-size: 90%;
}

div.accordion ul li a span {
padding-bottom: 10px;
}

div.accordion ul li a img {
border: 0;
vertical-align: bottom;
margin-right: 15px;
}

div.accordion ul li a:hover span {
text-decoration: underline;
}

#top_round {
height: 10px;
font-size: 1px; /* ie whitespace */
}

#bottom_round {
height: 10px;
font-size: 1px; /* ie whitespace */
}

.top_dark {
background: url("http://www.ryanscherf.net/demos/accordion/images/top_dark.gif") no-repeat top left;
}

.top_light {
background: url("http://www.ryanscherf.net/demos/accordion/images/top_light.gif") no-repeat top left;
}

.bottom_dark {
background: url("http://www.ryanscherf.net/demos/accordion/images/bottom_dark.gif") no-repeat top left;
}

.bottom_light {
background: url("http://www.ryanscherf.net/demos/accordion/images/bottom_light.gif") no-repeat top left;
}

.first {
padding-top: 5px;
}

.last {
padding-bottom: 5px;
}
</style>

Bước 2: Thiết lập HTML như bên dưới để đặt vào phần thân của trang HTML, nằm giữa 2 thẻ <body>, </body>.
<div id="wrap">
<div id="top_round"></div>
<div id="content">
<h3 class="toggler first" style="padding-top:5px;"><a href="#section1" onfocus="this.blur();">Section Title 1</a></h3>
<div class="accordion">
<ul>
<li><a href="#" onfocus="this.blur();"><img src="/images/image1.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image2.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image3.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image4.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image5.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image6.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image7.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image8.png" alt="" /><span>Link to other content area</span></a></li>
</ul>
</div>

<h3 class="toggler"><a href="#section2" onfocus="this.blur();">Section Title 2</a></h3>

<div class="accordion">
<ul>
<li><a href="#" onfocus="this.blur();"><img src="/images/image9.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image10.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image11.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image12.png" alt="" /><span>Link to other content area</span></a></li>
</ul>
</div>

<h3 class="toggler"><a href="#section3" onfocus="this.blur();">Section Title 3</a></h3>
<div class="accordion">
<ul>
<li><a href="#" onfocus="this.blur();"><img src="/images/image13.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image14.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image15.png" alt="" /><span>Link to other content area</span></a></li>
</ul>
</div>

<h3 class="toggler"><a href="#section4" onfocus="this.blur();">Section Title 4</a></h3>
<div class="accordion">
<ul>
<li><a href="#" onfocus="this.blur();"><img src="/images/image16.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image17.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image18.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image19.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image20.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src=" /images/image21.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image22.png" alt="" /><span>Link to other content area</span></a></li>
<li><a href="#" onfocus="this.blur();"><img src="/images/image23.png" alt="" /><span>Link to other content area</span></a></li>
</ul>
</div>

<h3 class="toggler last"><a href="#section5" onfocus="this.blur();">Section Title 5</a></h3>
<div class="accordion"><!-- no content hack --></div>
</div>
<div id="bottom_round"></div>
</div>
</div>

Bước 3: Đặt đoạn code sau đây trước thẻ đóng </body>.

<script type="text/javascript" src="http://www.ryanscherf.net/demos/accordion/accordion.js"></script>

Chú ý ở Bước 2, bạn phải tùy chỉnh scr theo URL các file hình ảnh tương ứng của bạn.
Hiệu ứng này có thể áp dụng cho Blogger khá dễ dàng.

Theo Ryanscherf.net

Tạo Menu sổ dọc nhiều cấp

Kiểu Menu sổ dọc có một ưu điểm là tiết kiệm không gian web cho trang web của bạn. Menu sổ dọc cũng là một lựa chọn tối ưu của khá nhiều website hiện nay. Ví dụ như trang Kitco.com.

Chỉ cần sử dụng một đoạn mã JavaScript đơn giản, bạn có thể tạo một Menu sổ dọc tự động dẫn đến các liên kết mỗi khi người dùng chọn các tùy chọn.


Trước hết, đặt đoạn mã dưới đây vào phần đầu của trang web, giữa các thẻ <head>, </head>.
<script language="javascript">
<!-- A the script from old browsers --
function goto(form) { var index=form.select.selectedIndex
if (form.select.options[index].value != "0") {
location=form.select.options[index].value;}}
//-->
</script>

Bước tiếp theo là đặt code HTML tại vị trí muốn tạo Menu như bên dưới.
<form name="form1">
<select name="select" onchange="goto(this.form)" size="1">
<option value="">-------Please choice-------
<option value="#">Title for item # 1</option>
<option value="#">Title for item # 2</option>
<option value="#">Title for item # 3</option>
<option value="#">Title for item # 4</option>
<option value="#">Title for item # 5</option>
<option value="#">Title for item # 6</option>
</select>
</form>

Bạn cần thay đổi các Tile for item tương ứng với tên menu con tùy chọn và đặt URL tương ứng cho các tùy chọn đó.