Friday, September 25, 2020

window resize

 


this.listStyle = {
height: (window.innerHeight - 85) + 'px',
overflow: 'auto'
};
this.windowWidth = window.innerWidth;
this.onResize('');




@HostListener('window:resize', ['$event'])
onResize(event) {
this.windowWidth = window.innerWidth;
this.listStyle = {
height: (window.innerHeight - 60) + 'px',
overflow: 'auto'
};
if(this.windowWidth <= 700){
this.maxHeaderChars = 20;
}
else if (this.windowWidth > 700 && this.windowWidth <= 1200){
this.maxHeaderChars = 50;
}
else{
this.maxHeaderChars = 100;
}
}




No comments:

Post a Comment

Autoboxing and Unboxing

  Autoboxing  is the automatic conversion that the Java compiler makes between the primitive types and their corresponding object wrapper cl...