Hello all,

I really (really!) enjoy using MochiKit. Even though I don't have much
experiance using JavaScript/DOM, I'm up, running, and building useful
apps. A testament to the design and documentation of MochiKit, if
nothing else. :)

Now for my question:
I see that I can make an visible/invisible with
showElement()/hideElement(). However, what if I want to toggle the
visible state of an element?

Currently my code checks visibility via elem.style.display == 'block'
(and assumes that means "visibility"), but it seems like there should
be a better/more intuitive way to do it. I would really like a
MochiKit function to get the visiblity... perhaps isShownElement()?

Baring that (or in addition to that), a toggleShownElement() (??)
function would be useful... although in my current project having
isShownElement() is more than enough, as I do some other manipulation
on (hiding or showing) an element.

Or, if someone wants to tell me how to check an items visibility in a
sane/cross-browser manner, I could put together the function + docs +
tests, I suppose.

Thanks in advance,
_Ryan Wilcox

PS: Please CC any replies to me, I monitor the list via Google's neat
"One Email A Day" feature.

--
=========================================
Wilcox Development Solutions:          <http://www.wilcoxd.com>
Toolsmiths for the Internet Age            PGP: 0x2F4E9C31

Reply via email to