How to check Space between Two images
Consider there are two images in a webpage.
I want know if they have any space rendere开发者_如何学运维d between them.
I'm using selenium tool and python language.
Answer could be in any language.
you can look up the position and size of each image quickly with javascript (I'm using jquery)
$('#image-one').width
height
x
y
$('#image-two')...same thing
Just see if the x of one is right next to the x+width of the other. Repeat for Y.
edit: there may be some issues with parents that have relative positioning. The code here is probably more bulletproof than just using x and y:
http://blog.firetree.net/2005/07/04/javascript-find-position/
精彩评论