Hide Show DIV Content with Links by using Javascript

The Hide and Show DIV elements for HTML content is a great way to clean up your sidebar. It becomes especially handy for those long blogroll lists or anything that clutters up the blog. Just simply click a link to make all the hidden content magically appear and disappear.

Demo:

+/- Click Here to Expand and Collapse



How to use it in Your Blog

Step 1: Adding CSS and Javascript
First, add this code below directly above the </head> tag.

<style type="text/css">
.commenthidden {display:none}
.commentshown {display:inline}
</style>
<script type="text/Javascript">
function togglecomments (postid) {
var whichpost = document.getElementById(postid);
if (whichpost.className=="commentshown") { whichpost.className="commenthidden"; } else { whichpost.className="commentshown"; }
} </script>

Step 2: Adding the Active Content to be Displayed
Place this code wherever you would like it to appear. Make sure to change the red text to a name that is "unique" to any other name in your template. An example might be "blogroll-dropdown". If you do not give each Hide Show DIV element a unique name the script cannot be used more than once on the same page. The green text is the title of the link that you click on to make the content appear. Replace the code "Expanded Content" with the content you wish to have expand and collapse.

<a aiotitle="click to expand" href="javascript:togglecomments('UniqueName')"
>Link Title</a><br />
<div class="commenthidden" id="UniqueName"
>Expanded Content</div>

Step 3: Sample Code
Here is what my code looks like for the demo above:

<a aiotitle="" href="javascript:togglecomments('hideshowdemo')">+/- Click Here to Expand and Collapse</a>
<div class="commenthidden" id="hideshowdemo"><ul><li><a href="http://howhero.com/">HowHero Tutorials</a></li><li><a href="http://widgetsforfree.blogspot.com/2008/09/translate-blog-widget-using-flags.html">Blog Translation Plugin</a></li><li><a href="http://widgetsforfree.blogspot.com/2008/09/make-money-blog-widget-performancing.html">Make Money Widget</a></li></ul>
</div>

This entry was posted in . Bookmark the permalink.

2 Responses to Hide Show DIV Content with Links by using Javascript

  1. Selling USA FRESH SSN Leads/Fullz, along with Driving License/ID Number with good connectivity.

    **Price for One SSN lead 2$**

    All SSN's are Tested & Verified. Fresh spammed data.

    **DETAILS IN LEADS/FULLZ**

    ->FULL NAME
    ->SSN
    ->DATE OF BIRTH
    ->DRIVING LICENSE NUMBER
    ->ADDRESS WITH ZIP
    ->PHONE NUMBER, EMAIL
    ->EMPLOYEE DETAILS

    ->Bulk order negotiable
    ->Hope for the long term business
    ->You can asked for specific states too

    **Contact 24/7**

    Whatsapp > +923172721122

    Email > leads.sellers1212@gmail.com

    Telegram > @leadsupplier

    ICQ > 752822040

    ReplyDelete
  2. SSN FULLZ AVAILABLE

    Fresh & valid spammed USA SSN+Dob Leads with DL available in bulk & high credit 700+

    >>1$ each SSN+DOB
    >>3$ each with SSN+DOB+DL
    >>5$ each for premium fullz (700+ credit score with replacement guarantee)

    Prices are negotiable in bulk order
    Serious buyer contact me no time wasters please
    Bulk order will be preferable

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    OTHER STUFF YOU CAN GET

    SSN+DOB Fullz
    CC's with CVV's (vbv & non-vbv)
    USA Photo ID'S (Front & back)

    All type of Tools & Tutorials available
    (Carding, spamming, hacking, scam page, Cash outs, dumps cash outs)

    SQL Injector
    Premium Accounts (Netflix, Pornhub, etc)
    Paypal Logins
    Bitcoin Cracker
    SMTP Linux Root
    DUMPS with pins track 1 and 2
    WU & Bank transfers
    Socks, rdp's, vpn
    Php mailer
    Server I.P's
    HQ Emails with passwords
    All types of tools & tutorials.. & much more

    Looking for long term business
    For trust full vendor, feel free to contact

    CONTACT
    Telegram > @leadsupplier
    ICQ > 752822040
    Email > leads.sellers1212@gmail.com

    ReplyDelete

Feedjit

New Page 1

Prestige Temple Bells NITESH CHELSEA Prestige Shantiniketan sale Prestige Kew Gardens Sobha silicon Oasis Sobha Valley View oceanus vista Purva 270 century silicon city nitesh caesars palace nitesh virgin island salarpuria sattva credenza brigade northridge vaswani claremont godrej united prestige gulmohar godrej garden city puravankara between the parks puravankara lalbaghroad purva between the parks provident the tree salarpuria sattva cadenza nitesh virgin island bangalore Godrej Prana Purva The Waves THE PRESIDENTIAL TOWER BANGALORE vaswani exquisite mantri energia prestige leela residences sobha halcyon bhartiya city leela residences lodha codename the central mantri energia bangalore mantri manyata tech park unishir experience unishir verzure mantri energia bangalore godrej sky byculla nitesh grand canyon nitesh rio kanakapura nitesh sloane square Sobha Aspirational Homes sobha golden quadrilateral prestige song of the south prestige kew gardens bangalore ajmera sports city salarpuria sattva east crest old madras road salarpuria sattva east crest salarpuria east crest salarpuria eastcrest sattva east crest godrej sky goyal alanoville salarpuria rhythm Sobha Green Acres Godrej Infinity Keshav Nagar Purva Silver Sands Keshavnagar Puravankara City Of Gold Purva City Of Gold Sobha Dream Acres Sobha Dream Series RMZ Marq RMZ Azure Bangalore Mahindra Windchimes Puravankara Limousine Homes Osadia Garden City Purva Limousine Homes Godrej The Trees Mumbai Prestige Song Of The South Begur Prestige Song Of The South Godrej Infinity Pune Salarpuria Sattva Pipal Tree Salarpuria Pipal Tree Salarpuria Sattva Casa Irene Salarpuria Casa Irene Lodha Codename Concept X Lodha Concept X Salarpuria Sattva Divinity

BTricks