Posts: 256
Location: Auckland, New Zealand
|
Here's an example of how to do something similar:
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-NZ">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<title>Javascript Hide/Unhide Elements</title>
<script type="text/javascript">
/*<![CDATA[*/
function toggleMessage(obj) {
var sibling = null;
if(obj.nextSibling.nodeType == 3)
sibling = obj.nextSibling.nextSibling;
else
sibling = obj.nextSibling;
sibling.style.display = (sibling.style.display == 'block') ? 'none' : 'block';
return false;
}
/*]]>*/
</script>
</head>
<body>
<div>
[<a href="" title="If it fails you might want to send them to a page at least?" onclick="javascript:toggleMessage(this);">Read More…</a>]
<p style="display: none;">This was not displaying but as you have clicked the link, it now appears.</p>
</div>
</body>
</html>
I didn't look at how that site above does it, but it shouldn't be too different, but it could work on element ids, this just works on the sibling elements, works for IE and FF.
Cheers,
MC
__________________
#------------------------------ signature---------------------------------------------------------------------------------#
Quote:
|
I am well recognised for what I don't do than what I do. Chores are just one of those things.
|
|