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);
}
}());
Use the event.currentTarget.offsetWidth
property instead of width
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With