Vani

YUI: Simple show/hide div using Module

Comments

Hello & thanks for the nice example. However I cannot get it to work when the code is in a fraction jsp (not complete with head & body) which is being injected into the main layout page (using YUI send async & insertion techinques). The hide/show link is then simply not working & the init function is not being called either (tested by adding an alert in it). If I have the code all in a full separate page it works fine. In both cases I (of course) have included the relevant css & YUI scripts. Please advice on anything I might have missed.

Thanks / V.
Hi. It's nice to see a YUI-based show/hide solution that isn't a bad hack or that requires anything other than YUI components. I'm using this method, but the content divs are expanded on page load. Is there a simple change to the script that would make them collapsed on load? I tried adding inline "display:none" to the divs, which didn't work.

Thanks for any help!

Advertisement