The offset method returns and object with top and left properties.

...
var coordsB = $(this).offset({ scroll: false });
...

Now you can get the top and left offsets like this:

var top = coordsB.top;
var left = coordsB.left;

--
Brandon Aaron

On Fri, May 23, 2008 at 1:51 PM, teazer <[EMAIL PROTECTED]> wrote:

>
> I need to save the coordinates of a div to be able to return it to the
> same location and am having problems posting the offset from
> dimensions.js
>
> This
>
> $(".dragL").mouseup(function(e){
>                var stroke = $(this).attr("id");
>                var coordsB = $(this).offset({ scroll: false });
>                $.post("pre_scripts.cfm", {
>                coords: e.pageX +','+ e.pageY,
>                coordsDiv: coordsB,
>                strokeNo: stroke
>                },
>                function(data){
>                  //alert(data);
>                  var commaAt = data.indexOf(',');
>                         $( '#' + data.substr(0, commaAt) ).text(
> data.substr(commaAt
> +1) );
>                });
>        });
>
> posts this
>
> COORDSDIV: [object Object]
> STROKENO: S2
> COORDS: 122,129
>
> How do I read [object Object]
>

Reply via email to