11
Với jQuery làm cách nào để tìm hiểu xem div one
có vượt quá div two
không? Không, chỉ số z cao hơn nhưng div là trực quan so với div khác.Nếu phần tử vượt quá một phần tử khác?
<style type='text/css'>
#one {
position:absolute; top:0; left:0; width:100px; height:100px; background-color:red; z-index:2;
}
#two {
position:absolute; top:0; left:0; width:100px; height:100px; background-color:green; z-index:1;
}
</style>
<div id='one'></div>
<div id='two'></div>
Đây có thể là một trùng lặp: http://stackoverflow.com/questions/8628368/how-do-i-implement-collision-detection-between-a-set-of-div-elements –