<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
</style>
</head>
<body class='hmmessage'>Dang! That's cool. I was hoping the callbacks would return something for "#html:". Thanks for the help! Ill play around with it when I get home.<br><br>So "#text:" doesn't expect the same thing as "#html:" then?<br><br>Oh, also. I recall a comment somewhere that you can only register one callback on a class? Does that only apply to seaside components?<br><br>Thanks!<br>RS<br><br>> Date: Tue, 22 Sep 2009 19:20:54 +0200<br>> Subject: Re: [Seaside] Detect the position of a page div<br>> From: renggli@gmail.com<br>> To: seaside@lists.squeakfoundation.org<br>> <br>> There is a bit too much nested AJAX going on for me ;-)<br>> <br>> >         script: ((html jQuery new draggable) onDrag: (<br>> ><br>> >                 (html jQuery ajax script: [:s | s add: ((s jQuery: #bobLeft)<br>> > html: (s jQuery ajax callback: [(s jQuery: #bob) offset access: 'left']))]),<br>> >                 (html jQuery ajax script: [:s | s add: ((s jQuery: #bobTop)<br>> > html: (s jQuery ajax callback: [(s jQuery: #bob) offset access: 'top']))])<br>> ><br>> >             )<br>> >         );<br>> <br>> The message #html: expects aRenderable, such as a block or a string of<br>> HTML, something that is generated by Seaside on the server. In your<br>> case you just display the script and that is what you see in the<br>> browser.<br>> <br>> If you replace #html with #text: and remove the roundtrip to the<br>> server this should already work:<br>> <br>> (html jQuery ajax script: [:s | s add: ((s jQuery: #bobLeft) text:<br>> ((s jQuery: #bob) offset access: 'left'))]),<br>> (html jQuery ajax script: [:s | s add: ((s jQuery: #bobTop) text:<br>> ((s jQuery: #bob) offset access: 'top'))])<br>> <br>> Now it displays the coordinates, but very much delayed as the script<br>> makes two round-trips to the server whenever you move the draggable<br>> element. In fact, this round-trip is not needed at all. If you remove<br>> all AJAX code the script becomes much simpler and faster. Furthermore,<br>> if you use the navigation facilities of jQuery you don't need any of<br>> the IDs and the script becomes:<br>> <br>> html div<br>> 	script: (html jQuery new draggable onDrag:<br>> 		((html jQuery this find: ':first') text: (html jQuery this offsetLeft)) ,<br>> 		((html jQuery this find: ':last') text: (html jQuery this offsetTop)));<br>> 	with: [ html div: 'left'; div: 'top' ]<br>> <br>> Note, I use #offsetLeft and #offsetTop here, two methods I added to<br>> jQuery this morning after your post. You might want to update to the<br>> latest code, or replace the calls with the old code #access:<br>> <br>> Cheers,<br>> Lukas<br>> <br>> -- <br>> Lukas Renggli<br>> http://www.lukas-renggli.ch<br>> _______________________________________________<br>> seaside mailing list<br>> seaside@lists.squeakfoundation.org<br>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside<br><br /><hr />Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. <a href='http://clk.atdmt.com/GBL/go/171222985/direct/01/' target='_new'>Sign up now.</a></body>
</html>