|
Yes, that would work. The values for 'left' and 'top' won't necessarily be relative to the browser though, so depending on how you're reusing them it could cause problems. If you're going to be setting the values in the same HTML layout it will be fine, but otherwise you might want to use Prototype's getCumulativeOffset instead.
As a tip, if you're using Scriptaculous anyway, then Prototype's $() method is available to you, to save having to type document.getElementById so often.
|