I was wondering if it's possible to calculate if a mouse click happened over the left or right half of the div element:
$("div").click(function(e){
// calculate if click happened on left or right half
});
<div>Variable Content</div>
Was hoping there would be a way to get the relative coordinates and relate them to the width of the div?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…