Container Effects on modules?
- I tried setting some container effects on the "module" class but they
don't work. I was using the built-in FADE and SLIDE effects. The
content shows, but not animated.
Is this supposed to work on a "module"?
I am trying to build something like this:
Where a user has a 1-line bar that when mouseover'd, expands into an
advanced search panel. However, I want it *inline*, that is I want
the rest of the document to slide down to make room for the advanced
Container effects seem to work only on Overlay and its subclasses,
which are absolutely positioned divs, and thus don't implement the
collapse/expand as I want.
- Ok, that would explain what I'm seeing, and but it does contradict the docs:At the bottom, see the list of properties, "effect" is in there. Also, on the subclasses (such as Overlay):It's documented that "effect" is inherited from Module.------------Follow-up question, is there a simple way with YUI to then "animate" the display of an inline module? I am trying to implement a "collapse/expand" pattern but I don't see a straightforward way to do that.I suppose I could animate the "height" from 0 to "full height" but the content is variable and I'd rather not lock that in. The YUI patterns site only shows animations of these effects, so it's tough to see how to implement it without a lot of trial and error.Ideas?Regards,AlanOn Feb 4, 2007, at 1:47 AM, Eric Miraglia wrote:
- Alan,Based on the documentation, I would tend to think it's a bug that ContainerEffect isn't working on Module; we'll look into that. I was aware that it wasn't implemented in Module, but I didn't notice last night that we'd written it up differently. Sorry for the confusion on that -- I know how frustrating that can be.As for what to do with your inline module in the meantime, you have a lot of good options. Animating height to zero is always easy, of course; as you say, it's going the other direction that's sometimes tricky.But I think Matt Sweeney (Animation Utility author) has a nice solution for you in this earlier post:Regards,EricOn Feb 4, 2007, at 7:57 AM, Alan Pinstein wrote:
- Ok, cool, thanks. That looks promising.I had also posted another doc issue regarding module visibility, if you want to check it out:Thanks again, YUI rocks. The good docs are a major part of why it's such a good tool, so just trying to contribute back when I can.AlanOn Feb 4, 2007, at 12:16 PM, Eric Miraglia wrote:
- Alan,Upon further investigation, Module was not intended to support Container Effect — it set up an abstract class for inheritance, but it left implementation up to descendant classes. The concept was that Module was not meant to be used raw, but rather as a foundation class for other components.The documentation, as you say, conveyed a different intent; when we update with our next release, that will be corrected.Regards,EricOn Feb 4, 2007, at 9:45 AM, Alan Pinstein wrote:
- Eric-Thanks for following up.So is it still true that Module isn't intended to be used raw? I am using it now as a chunk of inline block content that can collapse/expand. Is there a reason NOT to use it raw?I noticed in another post of yours you talked about the "new way" for building widgets going forward... and to look at TabView. Are blocks of content considered widgets?Since I am building support for YUI in my framework, I'd like to do it with the best-practices of YUI in mind. I'd appreciate any insight. I'm happy to read anything you link to, just looking for some "official" direction.Thanks,AlanOn Feb 8, 2007, at 8:19 PM, Eric Miraglia wrote:
- Alan,If Module is serving your needs, I don't see any reason not to use it. On some level, your comments make me think there's a place for Module to be a fully-realized control -- an in-the-page-flow unit that can be hidden or revealed with different transition effects. and updated using the Container API. It sounds like you're getting it to do those things, but perhaps that's something we should be providing more easily down the road as part of Module.Regards,EricOn Feb 8, 2007, at 7:28 PM, Alan Pinstein wrote:
- Thanks for the clarification.It is basically serving my needs. I wanted to create inline content much like the "boxes" on My Yahoo, but implement the "collapse/expand" pattern on them. The only reasonable widget to do this seemed to be module. Obviously there are no "built-in" effects for doing the transition, but that would be a great addition to YUI.I assume that anything in the YPattern library would eventually be easily implementable with YUI. So definitely there's a real need for inline block content features.Thanks again,AlanOn Feb 9, 2007, at 1:17 PM, Eric Miraglia wrote: