[英]get the width of the html element with this event
流星客戶端代碼需要事件發生但未能獲取的元素的寬度。 如何做呢? 謝謝
Template.swipe.events({
'mouseup .swipe': function(e) {
utility.mouseUp(e);
}
});
utility = (function () {
return {
mouseUp: (event) => {
console.log(event.currentTarget.width);
}
}());
使用event.currentTarget.offsetWidth
屬性而不是width
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.