Chia sẻ thủ thuật blogspot - blogger

luat1x1

10/30/2011

Tạo drop down menu cho label ( nhãn )

       Lần trước mình đã giới thiệu đến các bạn thủ thuật làm drop down liên kết của bạn, có thể xem TẠI ĐÂY, nhưng muốn áp dụng cho nhãn thì phải thủ công thôi. Bây giờ mình giới thiệu cho các bạn cách tự động.

Bạn có muốn hiển thị label ( nhãn ) bằng một drop down menu như thế này
image

thay vì như thế này không ?
image


Nếu muốn hiển thị một drop down menu thì hãy vào Chỉnh Sửa HTML chọn Mở rộng mẫu tiện ích và  tìm đoạn code phía dưới :

<ul>
   <b:loop values='data:labels' var='label'>
     <li>
       <b:if cond='data:blog.url == data:label.url'>
         <data:label.name/>
       <b:else/>
         <a expr:href='data:label.url'><data:label.name/></a>
       </b:if>
       (<data:label.count/>)
     </li>
   </b:loop>
   </ul>





và thay thế tất cả bằng đoạn code sau :






<select onchange='location=this.options[this.selectedIndex].value;' style='width:100%'>

<option>Mục Lục</option>
   <b:loop values='data:labels' var='label'>
      <option expr:value='data:label.url'><data:label.name/>
         (<data:label.count/>)
      </option>
   </b:loop>
</select>





Cuối cùng là Lưu Mẫu . chúc bạn thành công
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 nhận xét

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
© 2011 Luat1x1
Designed by BlogThietKe Cooperated with Duy Pham
Released under Creative Commons 3.0 CC BY-NC 3.0
Posts RSSComments RSS
Back to top