Assuming your view element is a child of a jquery widget, itβs best to probably capture the values ββyou want in the click handler:
var MyView = Backbone.Views.extend({ events: { 'dblclick #div1' : 'div1ClickHandler' } }); div1ClickHandler: function() { var $this = $(this); var $widget = $this.parents('.widget-selector:first'); $this.offset($widget.offset()); $this.height($widget.height()); $this.width($widget.width()); } var myView = new MyView({model: myModel,el :
If the jquery widget is always the direct parent of your view element, you can replace parents('.widget-selector:first') with parent() ; otherwise, you will need to replace the .widget-selector selector that will work for the jQuery widget.
source share