tags:

views:

20

answers:

1

Just bumped in to this great implementation on click expand http://www.timstravelog.com/lifelist/

I want to implement something similar for my own lifelist. Any recommendation on how to go about it? Is this jquery? I am a noob of shorts, so please excuse my ignorance

A: 

As a first step, look at the code :) (Which is a bit complicated here by the fact that the page uses XML+XSL, but still not hard to find the javascript.)

function changeDisplayState (id, caller) {
    e=document.getElementById(id);
    here=document.getElementById(caller);
    if (e.style.display == 'none' || e.style.display =="") {
        e.style.display = 'block';
        here.style.backgroundColor = '#C9C7C8';
    } else {
        e.style.display = 'none';
        here.style.backgroundColor = 'white';
    }
}

As you can see, it is plain javascript.

Tgr
Thanks! I did try view source both on chrome and firefox, didn't show me the JS, used firebug and saw the JS and CSS. :)
n00b