gpt4 book ai didi

javascript - 忽略取消触摸启动的尝试 : fastclick warning

转载 作者:行者123 更新时间:2023-11-30 15:36:30 25 4
gpt4 key购买 nike

我有第一个弹出窗口,另一个弹出窗口来选择几个字段。要显示第二个弹出窗口,这是我正在尝试的代码:

$("#select1").click(function(e) {
e.stopPropagation();
//$('#sellerModal').hide();
var tmplData = {
string:['Ready','2-3 Days','4-5 Days','1 Week','10+ Days']
};
$("#countTypePopupTemplate").tmpl(tmplData).appendTo(".maindiv");
that.closePopup();
$("#count_div").each(function() {
$("#count_div").click(function(evt) {
evt.stopPropagation();
$("#select1").text($(this).text());
$("#myCounttype").remove();
});
});
});

这是 HTML 模板:

<script id="countTypePopupTemplate" type="text/x-jquery-tmpl">
<div id="myCounttype" class="popup1 layer-2">
<div class="popup5">
{{each string}}
<div id="count_div" class="popup4 bottom-border">${$value}</div>
{{/each}}
</div>
</div>
</script>

我收到警告:

Ignored attempt to cancel a touchstart event with cancelable=false, for example, because scrolling is in progress and cannot be interrupted. fastclick.js

在这里,我无法在第二个弹出窗口中单击 5 个元素中的 4 个。只有第一个是可点击的。第二个弹出窗口的快照。

enter image description here

我阅读了所有讨论该主题的博客。但是没有任何解决方案适合我。看起来有一些极端情况。

最佳答案

尝试在 $("#count_div").each(function() {
$("#count_div").click(函数(evt) {
像这样 $(".parent_class #count_div").each(function() {
$(".parent_class #count_div").click(函数(evt) {

这将解决为 "#count_div" 运行 1 次 each() 的问题。

所以实际的问题是 each() 只运行了一次,这就是为什么你的第一个 Ready click 事件有效的原因,而不是其他的。

关于javascript - 忽略取消触摸启动的尝试 : fastclick warning,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41457630/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com