我正在使用嵌套的iscroll4,但
<li>
<div class="pullContainer">
<div class="wraps" id="w1">
<div class="scrolls" id="sc1">
<div id="pullDown1" class="pullDowns">
<span class="pullDownIcon"></span>
<span class="pullDownLabel1">Pull down to refresh...</span>
</div>
<div class="scrollContainer" id="nearBy"></div>
<!-- Template container -->
<script id="myTemplate" type="text/x-jquery-tmpl">
{{if (data.length > 0)}}
<ul class = "forSmooth" id="nearbyList">
{{each data}}
<li class = "smooth" data-businessId = "${$value.id}" data-distance = "${$value.distance}" data-prev-page ="homePage" onclick = "alert('hi');">
警报在这里发射两次......那么我怎样才能通过第二次射击来防止这种情况发生。
答案 0 :(得分:1)
试试这个:
<li class = "smooth" data-businessId = "${$value.id}" data-distance = "${$value.distance}" data-prev-page ="homePage" onclick = "AlertFunction()";">
function AlertFunction(e){
alert("Hi");
e.stopPropagation();
}
注意:完全未经测试的代码