Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

get the width of the html element with this event

This meteor client code needs the width of the element for which the event happened but failed to get it. How can it be done? Thanks

Template.swipe.events({
  'mouseup .swipe': function(e) {
    utility.mouseUp(e);
  }
});

utility = (function () {

  return {
    mouseUp: (event) => {
      console.log(event.currentTarget.width);
    }
}());
like image 575
Fred J. Avatar asked Sep 02 '25 06:09

Fred J.


1 Answers

Use the event.currentTarget.offsetWidth property instead of width.

like image 129
David Robles Avatar answered Sep 04 '25 21:09

David Robles