簡體   English   中英

使用此事件獲取html元素的寬度

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM