gpt4 book ai didi

jQuery 单击事件未按预期工作

转载 作者:行者123 更新时间:2023-11-29 02:58:34 25 4
gpt4 key购买 nike

以下脚本在除 IOS 之外的所有主要设备上都可以正常工作:

$(document).on("click", "#frmRoomSelector section[id^=roomDetails_] div.addRoomWrapperDynamic", {
rooms: HB.roomOptions,
captions: HB.roomPricingCaptions,
roomSelector: HB.oRoomSelector,
listItemTemplate: listItemTemplate
}, function(event) {
var data = event.data,
element = $(this).parent().parent(),
modalElement = $(".modal"),
elementId = element.attr("id"),
id = elementId.split("_")[1],
mealPlan = $(".meal-plan", element).html(),
roomType = element.data("isprivate") ? "private" : "shared",
roomOptions = data.rooms[id];
data.roomSelector.selectedRoomId = id;
if (mealPlan !== undefined) {
mealPlan = mealPlan.trim();
}
HB.RoomSelector.populateModalTemplate(modalElement, {
name: $(".roomName", element).html(),
price: $(".roomPrice", element).html(),
mealPlan: mealPlan,
caption: data.captions[roomType]
});

var options = [],
listItem = data.listItemTemplate.cloneNode(true); // Fresh copy of the template
for (var i = 0; i < roomOptions.length; i++) {
HB.RoomSelector.populateItemTemplate(listItem, {
roomId: "select_" + elementId + "_" + i,
bedsTotal: roomOptions[i].BEDS,
units: roomOptions[i].UNITS,
selectedOption: HB.RoomSelector.getBedsToBookValueById(id)
});
options.push(listItem.outerHTML);
}
$("#modal-room-selector ul", modalElement).html( options.join("") ); // This could be cached

modalElement.modal();
});

这是唯一应用于它的样式:

.addRoomWrapperDynamic,
.addRoomWrapperStatic{
float: right;
width: 64px;
text-align: center;
height: 101px;
padding-top: 20px;
margin-top: -1px;
}

.addRoomWrapperDynamic{
background-color: #70a6df;
}

HTML 是:

<div class="extraRoomInfo">
<span class="roomPrice<cfif len(stuViewVars.rstPropertyRooms.price) GT stuViewVars.longPriceThreshold> longPrice</cfif>">#stuViewVars.oLocaleCurrency.formatCurrency(fltPrice = stuViewVars.pricePerUnit, strCurrencyCode = uCase(stuViewVars.strCurrencyCode))#</span>
<input type="hidden" name="intRoomId_#stuViewVars.rstPropertyRooms.RoomID#" value="#stuViewVars.rstPropertyRooms.RoomID#" />
<input type="hidden" name="isPrivate_#stuViewVars.rstPropertyRooms.RoomID#" value="#stuViewVars.rstPropertyRooms.isPrivate#" />
<input type="hidden" name="intBedsToBook_#stuViewVars.rstPropertyRooms.RoomID#" value="0" id="intBedsToBook_#stuViewVars.rstPropertyRooms.RoomID#" />
<div class="addRoomWrapperDynamic">

<span class="icon-plus2"></span>
<span class="addRoomText">
<cfif stuViewVars.rstPropertyRooms.isPrivate>add rooms<cfelse>add beds</cfif>
</span>

</div>
</div>

当您点击“addRoomWrapperDynamic”时,boostrap 模式会淡入,它在任何地方都可以工作,但当您点击 ios 设备时,什么也不会发生。

最佳答案

document.addEventListener('touchstart', function(e) { 

}, false);

关于jQuery 单击事件未按预期工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23562208/

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