I have the following list:
<ul id="menu">
<li style="background-image:url('Images/X-AFH-Company-Office-Background.png')" id="office">
<!-- <div style="width:250px;height:300px;position:absolute;" ></div>-->
<div >Company / Office</div>
<img src="Images/Employee.png" onmouseover="this.src='Images/Employee-Stroke.png'" onmouseout="this.src='Images/Employee.png'" />
<img class="stroke" style="display:none" src="Images/Employee-Stroke.png" />
</li>
<li style="background-image:url('Images/X-AFH-Hospital-Clinic-Background.png')" id="clinic" >
<div >Hospital / Clinic</div>
<img src="Images/Doctor.png" onmouseover="this.src='Images/Doctor-Stroke.png'" onmouseout="this.src='Images/Doctor.png'" />
<div style="width:100px;height:350px;position:absolute;left:0;top:0;z-index:21"></div>
</li>
<li style="background-image:url('Images/X-AFH-University-School-Background.png')" id="school">
<div >University / School</div>
<img src="Images/Student.png" onmouseover="this.src='Images/Student-Stroke.png'" onmouseout="this.src='Images/Student.png'" />
</li>
etc...
And have a click event on the main <li>
on that list. However, the <img />
tags are overflowing from their parent <li>
s and are triggering the click event.
How can I only restrict the click event for the list item rather than their children? Even if they are going beyond the width and height of the main li.