In the events hash, i want to use resize event, but they do not work neither. However, click event works well. why resize does not work?
var SubheaderView = Backbone.View.extend({
id: 'gallery',
tagName: 'div',
events: {
'click #minor': 'getPadding',
'resize #minor': 'getPadding' //not work
},
initialize: function() {
this.render();
},
render: function() {
this.$el.append(subheaderTemplate);
},
getPadding: function() {
var pad_top = Math.floor($('#minor').height() * 0.4);
var pad_left = Math.floor($('#minor').width() * 0.07);
var pad = pad_top + 'px 0px 0px ' + pad_left + 'px';
$('#cover h1').css({'padding': pad});
}
});