One of the great things about the internet is the ability to (usually) view the source code and learn how a page was created. At the same time, this also creates a big problem when a page is created incorrectly and a bunch of people copy/use/learn from the wrong code. At first glance, whoever wrote that JS @ IHT's website seems to know what they're doing, so it looks like a safe script to learn from.
If you view IHT's articles and resize the browser window, you'll see their pretty cool article text JavaScript at work (it's more than just show and hide). I'd explain the effect but you can check it out yourself a lot faster.
I could also explain how to accomplish that effect step-by-step. However, that'd take a lot of time and the JS file at IHT's site has some decent documentation in its comments that helps you understand what each function does. So if you'd like the same effect, I'd recommend viewing that JS and LEARNING from it, then tweaking it to fit the needs of your site. If there are any specific parts of that script that are confusing to you, feel free to ask about them here and the forum members (including myself) would be happy to help you.
I have two problems with climaxdesigns' suggested hide reveal function (up this page). 1) The first time you click it after you load the page it does nothing, and then it works fine. 2) In Firefox (not in IE6), the actual bullet is not revealed. Here is the code: <ul> <li><a href="#" onclick="javascript:var hideObject=document.getElementById('hidvers'); hideObject.style.display=(hideObject.style.display=='none') ? 'block' : 'none';"> sometext</a></li> <li id="hidvers">sometext</li> </ul> It's inline because I only use it once. Another thing, though this is off topic, what is so good about doing rollovers in CSS instead of JavaScript? JavaScript rollovers are shorter, and if someone has disabled JavaScript they probably don't want annoying stuff like rollovers.
The reason it doesn't work on first click is relatively simple.. even though you've defined hidvers with display="none" as far as the javascript function is concerned (and for that matter the DOM) style.display is not set, that is.. until you set it.
for example when you first load the page and run the function "hideObject.style.display" actually equates to null. You'd have to use element.getAttribute("style") or some such thereof to get the infomation that's been loaded via CSS.. which honestly isn't worth it, and since the previous function actually works the second click we know that we don't need to. That being said here's the fix.. If you've hidden the element via css change this line to:
that way a "null" result will return false (just like a "none" result) and therefore the secondary display setting will be used which in this case is "block"
As for your CSS rollover question.. it's all about graceful degradation. Why use javascript to accomplish something that's just as easily set by CSS? I mean, just because someone disables javascript doesn't mean they want a website to look any different, and with certain styles subtle rollovers make that difference. And really what's easier than:
a {background:url(image) 0 0 no-repeat} a:hover{background:url(image) 0 -38px no-repeat}