1) Setting focus
In your Ajax call add:
evalScripts:true
as a parameter. In your response, add a JavaScript block to set the
focus as you normally would - $('someID').focus()
2) Scrolling
Find the position of a DIV at the bottom of the screen. I like this
handy function from Quirksmode:
function findPos(obj) {
var curleft = curtop = 0;
if (obj.offsetParent) {
curleft = obj.offsetLeft
curtop = obj.offsetTop
while (obj = obj.offsetParent) {
curleft += obj.offsetLeft
curtop += obj.offsetTop
}
}
return [curleft,curtop];
}
so you would do this:
myPos = findPos($('someDiv'))
window.scrollTo(0,myPos[1])
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---