点击图标跳转到页面1,点击其他地方跳转到界面2,而且点击其他地方的时候,整体要有蓝色边框,这个怎么实现。
现在的情况是点击图标也会跳转到页面2.
<label id="option1" value="1" name="options" class=" btn btn-block container-address" style="text-align: left;">
<div class="width-75 pull-left info-box " >
<input type="radio" >
<div class="row col-xs-12">
<div id="text" class="width-30 pull-left text">AAA:</div>
<div id="name1" class="width-30 pull-left name">BBB</div>
<div id="phone1" class="width-40 pull-left phone">BBB</div>
<div id="address1" class="address">BBB</div>
</div>
</div>
<div class="width-20 pull-right btn block-btn ">
<center class="icon-edit icon-button2 icon-block"><a href="enterAddress.html"><span ></span></a></center>
</div>
</label>
图标的点击事件处理时阻止冒泡试试。
楼上所说的是第一步,你要点击空白就给document绑定事件
没用阻止事件冒泡
1. event.preventDefault();
-- 阻止元素的默认事件。
2. event.stopPropagation();
-- 阻止元素冒泡事件