16 Dec 2012
Blog Archive links Collapsed by Default Hack
Prerequisites for this to Work
Before you apply this remember that you have to have a Blog Archive Widget present and the Style has to be set to Hierarchy (as shown in picture below )
Applying this to your Blog
To add using One Click Installer Method
Or just add the following Code in your Blog (preferably before the </body> tag in the Edit HTML of the Template tab )
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script>
if ( $('.archivedate').hasClass('expanded') )
{
$('.archivedate').removeClass('expanded');
$('.archivedate').addClass('collapsed');
}
</script>
What this code does
It firstly checks if a element having class name "archivedate" also has a class "expanded" present in it. If this turns out to be true then it removes the "expanded" class and adds a class named "collapsed" .
If you face any problem implementing it in your blog then feel free to ask via comments
Til next time,
Prayag Verma
at 19:41