All pastes #48062 Raw Edit

Anonymous

public html v1 · immutable
#48062 ·published 2006-04-04 05:00 UTC
rendered paste body
<style>.album .description,.album p{	display: none;}.album .description{	border: 1px solid #999;	padding: 5px;	position: absolute;	right: 5px;	top: 5px;}</style><script>// Toggle albumfunction toggleAlbum(obj){	var top = obj.parentNode;	var dis = obj.open ? 'none' : 'block';	// Loop through child nodes	for (var i = 0; i < top.childNodes.length; i++)	{		// Toggle node visibility		if (top.childNodes[i] != obj && top.childNodes[i].style)				top.childNodes[i].style.display = dis;	}	// Toggle open status	obj.open = (!obj.open);	// If the new status is open	if (obj.open)	{		var links = document.getElementsByTagName('a');		// Toggle all other open titles		for (var i = 0; i < links.length; i++)		{			if (links[i].className == 'toggle' && 					links[i] != obj && links[i].open) toggleAlbum(links[i]);		}	}}// Run when the page is loadedwindow.onload = function(){	var links = document.getElementsByTagName('a');	// Iterate through and find toggle links	for (var i = 0; i < links.length; i++)	{		if (links[i].className == 'toggle')		{			// Set it to toggle			links[i].setAttribute('onClick', 'toggleAlbum(this)');			links[i].setAttribute('href', 'javascript:;');		}	}}</script><div class="album"><a class="toggle">Test 1</a><div class="description">Description 1</div><p>Asd</p></div><div class="album"><a class="toggle">Test 2</a><div class="description">Description 2</div><p>Asd</p></div><div class="album"><a class="toggle">Test 3</a><div class="description">Description 3</div><p>Asd</p></div>