It's hard to tell what's wrong without seeing your HTML.
If 'toScroll' is inside 'Content' then you will get zero because the
BlindDown has not run by the time you're calling your alert box. If
this is the case, try this:
new Effect.BlindDown('Content', {afterFinish:function() {alert($
('toScroll').offsetHeight)}});
On Mar 7, 10:31 am, Ztripez <[EMAIL PROTECTED]> wrote:
> Hello everyone!I need to get the height of a div after i updated it's
> content on a ajax update. The problem is that it't returns 0.
> (I need to get the height because i'm wringing a costumized
> pagescroller).
>
> The code is:
>
> function open_page(page_name)
> {
> new Ajax.Request(page_name, {
> method:'get',
> onSuccess: function(transport){
> var page = transport.responseText.evalJSON();
> var newBg = "url("+ page.bg +")";
> $('Container').style.backgroundImage
> = newBg;
> $('toScroll').innerHTML =
> page.content;
> $('PageTitle').innerHTML = page.title;
> $('toScroll').style.top = '0px';
> new Effect.BlindDown('Content');
> alert($('toScroll').offsetHeight);
>
> }
> });
>
> }
>
> The alert returns 0.
> I've tried to set the height: auto in the CSS but it chnages nothing.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---