Re: Scrolling browser to newly visible panel?

2007-10-11 Thread Gwyn Evans




Thanks, I've gone with

  target.appendJavascript(
  "document.getElementById('" + form.getMarkupId() + "').scrollIntoView(false);"
  );

in the onClick(), which seems to do just what I need.

/Gwyn

On Wednesday, October 10, 2007, 9:18:58 PM, Gerolf [EMAIL PROTECTED] wrote:







i found two possibilities to do this (although i haven't tried it with wicket ajax):

var el = document.getElementById('panelInsertedViaAjax');
1)
document.getElementsByTagName('body')[0].scrollTop = el.offsetTop + el.offsetHeight;
2)
el.scrollIntoView(false);
// false to position it to the bottom of the page
// true for the top

Gerolf



On 10/10/07,Gwyn Evans[EMAIL PROTECTED] wrote:
Just wondering if there was anything that might help with the
following?

In a web page design I've been given, I may need to display an
'options' form to get additional input. I'm doing this with Ajax,
but the problem is that it typically appears off the bottom of the
existing page - is there a good way of triggering the browser to do
something like scroll down, ideally to the bottom of the new form?

--
Best regards,
Gwyn mailto:[EMAIL PROTECTED]


-
To unsubscribe, e-mail:[EMAIL PROTECTED]
For additional commands, e-mail:[EMAIL PROTECTED]









/Gwyn




-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Scrolling browser to newly visible panel?

2007-10-10 Thread Gwyn Evans
Just wondering if there was anything that might help with the
following?

In a web page design I've been given, I may need to display an
'options' form to get additional input.  I'm doing this with Ajax,
but the problem is that it typically appears off the bottom of the
existing page - is there a good way of triggering the browser to do
something like scroll down, ideally to the bottom of the new form?

-- 
Best regards,
 Gwyn  mailto:[EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Scrolling browser to newly visible panel?

2007-10-10 Thread Gerolf Seitz
i found two possibilities to do this (although i haven't tried it with
wicket ajax):

var el = document.getElementById('panelInsertedViaAjax');
1)
document.getElementsByTagName('body')[0].scrollTop = el.offsetTop + el
.offsetHeight;
2)
el.scrollIntoView(false);
// false to position it to the bottom of the page
// true for the top

Gerolf


On 10/10/07, Gwyn Evans [EMAIL PROTECTED] wrote:

 Just wondering if there was anything that might help with the
 following?

 In a web page design I've been given, I may need to display an
 'options' form to get additional input.  I'm doing this with Ajax,
 but the problem is that it typically appears off the bottom of the
 existing page - is there a good way of triggering the browser to do
 something like scroll down, ideally to the bottom of the new form?

 --
 Best regards,
 Gwyn  mailto:[EMAIL PROTECTED]


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]




Re: Scrolling browser to newly visible panel?

2007-10-10 Thread Nathan Hamblen

Gwyn Evans wrote:
 I'm doing this with Ajax,
 but the problem is that it typically appears off the bottom of the
 existing page - is there a good way of triggering the browser to do
 something like scroll down, ideally to the bottom of the new form?

findpos(elem) has worked well for me on ajax-added elements:
http://www.quirksmode.org/js/findpos.html

Also this is good for the scrolling part:
http://www.quirksmode.org/viewport/compatibility.html

And then if you wanted to animate the scrolling, and also wonder why 
this seemingly common need is not addressed by popular effects 
libraries, there's:

http://technically.us/code/x/dragging-and-dropping-effects

Nathan



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]