For the sake of clarity and to be succinct I've created this script which has to functions, to run the checkSize method on page-load and run the script when the browser resizes. My problem is that I cannot get execute the checkSize at all.
Any help would be greatly appreciated!!
class thisDiv {
constructor() {
this.element = $('.div');
this.window = $(window);
this.checkSize();
this.events();
}
events() {
this.window.resize(this.checkSize);
}
checkSize() {
this.element.addClass('red');
}
}
export default thisDiv;