<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
I see how it works now. The js functions are captured in the callbacks, and the callbacks are triggered when an event takes place (in this case #onDrag:). Here is my updated code:<br><br>&nbsp;&nbsp;&nbsp; html div<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; id: 'areaView';<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; script: ((html jQuery new draggable) grid: #(150 150); onDrag: (<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; html jQuery ajax<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:value | self top: value] value: (html jQuery this offset access: 'top');<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; callback: [:value | self left: value] value: (html jQuery this offset access: 'left')<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; with: ["..."].<br><br>One thing I just realized is that #onDrag: is trigged as long as the dealy bob (html element) is bein dragged, but not at a regular consistency. Even with the grid function, it still can't keep up with what I'm doin on the page. I havn't tried it yet, but I was thinking maybe I could use scrollspeed or something to fix this little problem... or maybe it doesn't matter. I suppose it's updating the offset correctly, so if it skips a few movements, the smoothness of what I'm doing with this data will just be a little... well, less smooth.<br><br>Anyway, I had a question about the primary/secondary callbacks again: <br><br>Lukas:<br>"<br>You can only register one primary callback for an ajax object, e.g.<br><pre> <br>  html jQuery ajax callback: [ ... ]; callback: [ ... ]  " &lt;-- wrong "<br> <br>does not make sense, because Seaside returns a response after<br>processing the primary callback. However you can register as many<br>secondary callbacks as you want, e.g. to serialize values to the<br>server:<br> <br>  html jQuery ajax " &lt;-- correct "<br>     callback: [ :v1 | "this is a secondary callback" ] value: ....;<br>     callback: [ :v2 | "this is a secondary callback" ] value: ....;<br>     html: [ :h | "this is a primary callback that generates html,<br>internally it calls #callback:" ];<br>     ...<br> <br>Note that the primary callback is always evaluated last, whereas the<br>secondary callback are evaluated before in order they were defined.<br>"<br><br>So if I am passing a value to the callback it is considered a secondary callback because it doesn't have to<br>go and find values or something? Sorry, would you mind explaining it again?<br><br>Thanks!<br>RS<br></pre><br><br>&gt; Date: Wed, 23 Sep 2009 08:28:17 +0200<br>&gt; Subject: Re: [Seaside] Detect the position of a page div<br>&gt; From: renggli@gmail.com<br>&gt; To: seaside@lists.squeakfoundation.org<br>&gt; <br>&gt; &gt; Alright, I think I'm starting to understand the process of events here. What<br>&gt; &gt; I'm still confused about, however, is exactly what "#text:" does. How is it<br>&gt; &gt; able to render the value of "((html jQuery: #whatever) offset access:<br>&gt; &gt; 'top')" when I can't assign that value to a component variable, render it<br>&gt; &gt; with "#html:", or even show it with Transcript? Is that because the function<br>&gt; &gt; has to be rendered (for JavaScript to deal with) first?<br>&gt; <br>&gt; Unless you use AJAX, all the code execution happens in Javascript in<br>&gt; the web browser:<br>&gt; <br>&gt;      (html jQuery: #foo) text: (html jQuery: #bar) offsetLeft<br>&gt; <br>&gt; In this case the expression is transformed to Javascript something<br>&gt; along the following lines:<br>&gt; <br>&gt;      $("#foo").text($("#bar").offset.left)<br>&gt; <br>&gt; Have a look at the generated code in FireBug.<br>&gt; <br>&gt; &gt; How can I get the offset value and store it in an instance variable then?<br>&gt; <br>&gt; Attach this script to the #onStop: handler of the draggable:<br>&gt; <br>&gt; html ajax<br>&gt;     callback: [ :value | left := value ] value: (html jQuery: #bar) offsetLeft;<br>&gt;     callback: [ :value | top := value ] value: (html jQuery: #bar) offsetTop<br>&gt; <br>&gt; Again check out the generated code in FireBug and inspect the request<br>&gt; it triggers off.<br>&gt; <br>&gt; Cheers,<br>&gt; Lukas<br>&gt; <br>&gt; -- <br>&gt; Lukas Renggli<br>&gt; http://www.lukas-renggli.ch<br>&gt; _______________________________________________<br>&gt; seaside mailing list<br>&gt; seaside@lists.squeakfoundation.org<br>&gt; http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br>                                               <br /><hr />Bing™  brings you maps, menus, and reviews organized in one place. <a href='http://www.bing.com/search?q=restaurants&form=MLOGEN&publ=WLHMTAG&crea=TEXT_MLOGEN_Core_tagline_local_1x1' target='_new'>Try it now.</a></body>
</html>