Usually you don't want the content's sticking out of the element
during animation. For example, you have a paragraph with some text and
a background-color. Without overflow:hidden, the background shape
would slide up while the text stays visible all the way, only
dissapearing suddenly at the end.

Can't you expand your container to fit the close button inside and use
margins?

>From some quick testing you can work around that by setting the
overflow right after the animate() call:

$(myEl)
 .animate(...)
 .css('overflow', 'visible');

cheers,
- ricardo

On Apr 4, 8:13 am, kofkof <kof...@laposte.net> wrote:
> Hello all,
>
> I have two questions regarding this portion of the animate() method
> source code:
> /******************************/
> for ( p in prop ) {
>         [...]
>         if ( ( p == "height" || p == "width" ) && this.style ) {
>                 [...]
>                 // Make sure that nothing sneaks out
>                 opt.overflow = this.style.overflow;
>         }
>
> }
>
> if ( opt.overflow != null )
>         this.style.overflow = "hidden";
> /******************************/
>
> I might be wrong (really), but to me this means that *whenever* an
> animation is executed on an element's width or height, the element wil
> get overflow:"hidden", no exception (this.style.overflow can only
> return "visible", "hidden" or an empty string, and the three of them
> are different from null, if I'm not wrong...)
>
> My problem today is related to this issue. I want to animate the size
> of a div with a child div inside it, set to overflow in its top-left
> corner, (kind of like the close button on Fancy Zoom's popups 
> -http://www.cabel.name/2008/02/fancyzoom-10.html). With jQuery animate
> (), the parent div gets overflow:"hidden" and therefore the inside div
> is clipped during the anim... If I comment "opt.overflow =
> this.style.overflow" in jQuery's source code, everything runs as
> expected, no clipping.
>
> So, my two questions are:
> 1) what's the use of this automatic swtching to overflow:"hidden"?
> 2) I can't think of a way to keep my element's overflow to "visible"
> during its animation (without having to comment the above mentionned
> line on jQuery source...). Any idea, anyone?
>
> Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-dev@googlegroups.com
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to