Hi Dave,
thanks for your help - from the Author of "Ajax in Action" in person.
Your book is on my Amazon Wishlist for weeks, really...
I'm really impressed :-)
In your case, the lag can probably be worked around - I
assume you're not
trying to talk to the database in real time, but only after the drop
operation.
Yes, this is correct. Your example exactly fits my needs ;-)
But your example brings me to a quite pragmatic question...:
How can I access variables from the inline-function?
Here's what I got now:
/* ----------------- */
Event.observe($('notice'),'mousemove', function() {
posX = $('notice').offsetLeft;
posY = $('notice').offsetTop;
$('notice_content').innerHTML = posX+"/"+posY; }
)
/* ----------------- */
posX and posY are now storing the correct position of my element, I can
check this by printing them out via innerHTML.
But if I try to use posX/posY OUTSIDE of the Event.observe (f.e. with a
simple alert(posX)), JS throws an error "posX not defined".
Is there a good way to handle this? I'm pretty new to JS/DOM Scripting,
so please excuse if this is a newbie question... :-/
Daniel
HTH
Dave
--
----------------------
Author
Ajax in Action http://manning.com/crane
Ajax in Practice http://manning.com/crane2
Prototype & Scriptaculous Quickly http://manning.com/crane3
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" 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/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---