I came across a user case where I had to programatically scroll the contents of a div to the right. This was
to be performed on a click of an ajax link. This is how I achieved the same:
onSubmit(AjaxTarget....)
{
.... body of onsubmit , additional operations.
target.appendJavascript("var obj = document.getElementById('divid');obj.scrollLeft = 500;");
}
some additional methods which could be used on the window itself rather than a div are
scrollBy
scrollTo
moveBy
Thank You so much for this.
ReplyDelete