How to get item position in real time

I need to get the div position in real time, and I'm trying to do the following:

html div
  id: 'square';
  script: (html jQuery new draggable 
    onStop: (html jQuery ajax 
      callback: [Transcript show: html jQuery this position])).

Unfortunately, this does not work, the transcript shows: 'a JQueryInstance ($ (this) .position ())'

What is the right way to do this?

+3
source share
1 answer

Try the following:

 html div 
   id: 'square'; 
   script: (html jQuery this draggable  
     onDrag: ((html jQuery script: 
     [:builder | builder <<  (builder jQuery get                                       
       callback: [ :value | Transcript show: (value at: 'top')@(value at: 'left')]
       json: (builder jQuery this position) ). 
     ]) asFunction: #(event ui)

html jQuery script -text, , . Transcript, , . script , : json:, script, json:, Seaside ajax, .

+2

Source: https://habr.com/ru/post/1792250/


All Articles