Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Blogger Archive Menu XHTML Valid (See related posts)

Runs the archives backwards, so that the most recent month is at the top of the menu.

     <ul class="archive-list"><li><select name="archivemenu" id="archivemenu"
style="width:100%;background-color:#000000;color:#006666;font-weight:bold;"
onchange="document.location.href=this.options[this.selectedIndex].value;" >
<option selected="selected" value="archives">archives</option>
</select></li></ul>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var archives = new Array();

<BloggerArchives>
archives[archives.length] = new Array('<$BlogArchiveURL$>', '<$BlogArchiveName$>');
</BloggerArchives>
var theSel = document.getElementById('archivemenu');
for (var i=archives.length-1;i>=0;i--) {
var newOpt = new Option(archives[i][1], archives[i][0]);
var selLength = theSel.length;
theSel.options[selLength] = newOpt;

}
//--><!]]>
</script>

You need to create an account or log in to post comments to this site.


Click here to browse all 5146 code snippets

Related Posts