I am trying to set a box A to jump to the same x-position as box B. How do I do this? I tried the开发者_Python百科 following but it does not work (the second line):
$("#boxa").animate({
   left: $("#boxb").left
}, 1000, function() { });
});
Thanks,
Sam
either
$('#boxB').css('left');
or
$('#boxB').offset().left;
For properties specified in pixels, using:
$('#boxB').css('padding-left');
gives a string like: '22px'
Maybe it's better to use:
parseInt($('#boxB').css('padding-left'), 10);
in such cases, which gives a number like 22 .
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论