[Seaside] Detect the position of a page div
Robert Sirois
watchlala at hotmail.com
Tue Sep 22 16:18:36 UTC 2009
I was hoping to display the offset values of a draggable element within itself.
renderContentOn: html
html div
id: 'bob';
script: ((html jQuery new draggable) onDrag: (
(html jQuery ajax script: [:s | s add: ((s jQuery: #bobLeft) html: (s jQuery ajax callback: [(s jQuery: #bob) offset access: 'left']))]),
(html jQuery ajax script: [:s | s add: ((s jQuery: #bobTop) html: (s jQuery ajax callback: [(s jQuery: #bob) offset access: 'top']))])
)
);
with: [
html div
id: 'bobLeft';
with: 'left'.
html div
id: 'bobTop';
with: 'top'.
].
This code doesn't really work either, as it just displays the js function within the callback. I think I'm missing the part where it needs to return something? Btw, I got your code to run fine, thank you.
RS
> Date: Tue, 22 Sep 2009 10:14:48 +0200
> Subject: Re: [Seaside] Detect the position of a page div
> From: renggli at gmail.com
> To: seaside at lists.squeakfoundation.org
>
> I don't understand what you are asking for, but what about something along?
>
> html jQuery ajax
> callback: [ :left | Transcript show: left ]
> value: (html jQuery offset access: 'left');
> callback: [ :top | Transcript show: top ]
> value: (html jQuery offset access: 'top')
>
> I am just adding a few convenience methods that should make things
> like this easier.
>
> Lukas
>
> 2009/9/22 Robert Sirois <watchlala at hotmail.com>:
> > Is there a way to detect the offset of a given element on a page? The
> > following simply returns '$this.offset()'.
> >
> > html div
> > id: 'bob';
> > script: ((html jQuery new draggable) onDrag: (html jQuery ajax
> > script: [:s | s add: ((html jQuery: #bob) html: (html jQuery: #bob)
> > offset)]));
> > with: html jQuery this offset.
> >
> > Thanks!
> > RS
> >
> > ps.
> >
> > If it helps, the purpose of this function is to let the server know if a map
> > is being moved in order to buffer the new tiles; essentially, a tiling
> > script (ie. Google maps).
> >
> > ________________________________
> > Hotmail® has ever-growing storage! Don’t worry about storage limits. Check
> > it out.
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> >
> >
>
>
>
> --
> Lukas Renggli
> http://www.lukas-renggli.ch
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
_________________________________________________________________
Ready for Fall shows? Use Bing to find helpful ratings and reviews on digital tv's.
http://www.bing.com/shopping/search?q=digital+tv's&form=MSHNCB&publ=WLHMTAG&crea=TEXT_MSHNCB_Vertical_Shopping_DigitalTVs_1x1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090922/b3668434/attachment-0001.htm
More information about the seaside
mailing list