I just came back to this problem and thought I''d share the work
around I used.
Looks like ''Effect.Scale'' isn''t understanding the
padding on the
div. I had to put another div inside of the one I''m putting the
''Puff'' against and move the padding to that div instead.
It now works as expected for me.
I''ve created a ticket so it''s documented for the future -
http://
dev.rubyonrails.org/ticket/3514
Chris Nolan.ca
http://kekova.ca/
On Jan 12, 2006, at 11:38, Chris Nolan.ca wrote:
> I''m trying to get to the bottom of this one. Not much for
> Javascript debugging, but found the Venkman tool and have been
> stepping through the code trying to see where things go wrong.
> Looks like it just might be a conflict with the style but lets give
> some background.
>
> I''m doing a
''Effect.Puff(''my_div'')'' on an onclick, and
it''s
> disappearing itself, i.e. the link is inside of the div in
> question. Watching it closely though and it seems to do a quick
> jump to a new size and then slowly do the rest of the effects.
>
> Stepping through the code the issue occurs in the
''render'' when it
> calls this.update. Digging into the update (which is in
> Effect.Scale) it calls the setDimensions and passes in reasonable
> values, in this case 144 high, 421 wide. Inside of there it does
> the setStyle passing in again, correct values.
>
> This is where it goes fishy. Inspecting the element before the
> setStyle I can see the correct values for ''currentHeight''
and
> ''currentWidth''. But as soon as the setStyle happens, the
size gets
> messed up (i.e. 204 & 478). Note, if I look @ the element.style
> before it happens, it doesn''t have any of the
top/left/height/width
> - so somehow when it gets them, it must be taking some other
> factors into consideration when it needs to figure out the size.
>
> Anybody know why?
>
> Also, it seems un-related but the ''pos'' that gets
calculated
> earlier seems pretty fishy. i.e. the first iteration it''s 6*10-8
> plus or minus. Some weird math when 1-0 happens on the .from
> and .to. The next time through the loop it''s a decent value.
>
> Thanks,
> Chris Nolan.ca
> http://kekova.ca/