Re: [Proto-Scripty] Need to scroll to the bottom of page after element is updated

2010-09-07 Thread rob anderson
Yes, that worked.  Thanks for the tip!

On Sat, Sep 4, 2010 at 1:41 AM, yuval dagan  wrote:

> try using the functions:
>
>  scrollBy()  Scrolls
> the content by the specified number of pixels 
> scrollTo()
> http://www.w3schools.com/jsref/obj_window.asp
>
> yuval
>
> On Fri, Sep 3, 2010 at 7:02 PM, sentor  wrote:
>
>> Hi All,
>>
>> Total Newb question (new to java script ajax and prototype). The code
>> below calls a cgi, which returns some html which appears under
>> mainFrame.  I'm using PeriodicalUpdater and as you can see, the cgi is
>> called every second.  Works like a champ.  The one hurdle I have yet
>> to overcome is always having the scroll bar at the bottom of the
>> page.  So, similar to a chat box, I always want to see the latest data
>> at the bottom of the screen, without manually scrolling down.
>>
>> I found a thread that proposed using the onComplete, or even the
>> onSuccess event to achieve this.  It's implemented below. however, it
>> doesn't seem to work.
>>
>> Any help you can offer is greatly appreciated.
>>
>> ---
>> 
>> 
>>
>> 
>> 
>>
>> var container = 'mainFrame';
>> var url = '/cgi-bin/sessions.cgi';
>> new Ajax.PeriodicalUpdater(container, url, {
>>method: 'get',
>>insertion: Insertion.Bottom,
>>frequency: 1,
>>decay: 0,
>>onComplete: function() {
>>(function() {
>>container.scrollTop = container.scrollHeight;
>>});
>>}
>>  });
>>
>> 
>>
>> 
>> 
>>
>> 
>>
>> 
>> 
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Prototype & script.aculo.us" group.
>> To post to this group, send email to
>> prototype-scriptacul...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> prototype-scriptaculous+unsubscr...@googlegroups.com
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>>
>>
>  --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



Re: [Proto-Scripty] Need to scroll to the bottom of page after element is updated

2010-09-04 Thread yuval dagan
try using the functions:

scrollBy() Scrolls the
content by the specified number of
pixelsscrollTo()
http://www.w3schools.com/jsref/obj_window.asp

yuval

On Fri, Sep 3, 2010 at 7:02 PM, sentor  wrote:

> Hi All,
>
> Total Newb question (new to java script ajax and prototype). The code
> below calls a cgi, which returns some html which appears under
> mainFrame.  I'm using PeriodicalUpdater and as you can see, the cgi is
> called every second.  Works like a champ.  The one hurdle I have yet
> to overcome is always having the scroll bar at the bottom of the
> page.  So, similar to a chat box, I always want to see the latest data
> at the bottom of the screen, without manually scrolling down.
>
> I found a thread that proposed using the onComplete, or even the
> onSuccess event to achieve this.  It's implemented below. however, it
> doesn't seem to work.
>
> Any help you can offer is greatly appreciated.
>
> ---
> 
> 
>
> 
> 
>
> var container = 'mainFrame';
> var url = '/cgi-bin/sessions.cgi';
> new Ajax.PeriodicalUpdater(container, url, {
>method: 'get',
>insertion: Insertion.Bottom,
>frequency: 1,
>decay: 0,
>onComplete: function() {
>(function() {
>container.scrollTop = container.scrollHeight;
>});
>}
>  });
>
> 
>
> 
> 
>
> 
>
> 
> 
>
> --
> You received this message because you are subscribed to the Google Groups
> "Prototype & script.aculo.us" group.
> To post to this group, send email to
> prototype-scriptacul...@googlegroups.com.
> To unsubscribe from this group, send email to
> prototype-scriptaculous+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/prototype-scriptaculous?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.



[Proto-Scripty] Need to scroll to the bottom of page after element is updated

2010-09-03 Thread sentor
Hi All,

Total Newb question (new to java script ajax and prototype). The code
below calls a cgi, which returns some html which appears under
mainFrame.  I'm using PeriodicalUpdater and as you can see, the cgi is
called every second.  Works like a champ.  The one hurdle I have yet
to overcome is always having the scroll bar at the bottom of the
page.  So, similar to a chat box, I always want to see the latest data
at the bottom of the screen, without manually scrolling down.

I found a thread that proposed using the onComplete, or even the
onSuccess event to achieve this.  It's implemented below. however, it
doesn't seem to work.

Any help you can offer is greatly appreciated.

---






var container = 'mainFrame';
var url = '/cgi-bin/sessions.cgi';
new Ajax.PeriodicalUpdater(container, url, {
method: 'get',
insertion: Insertion.Bottom,
frequency: 1,
decay: 0,
onComplete: function() {
(function() {
container.scrollTop = container.scrollHeight;
});
}
  });











-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.