JQuery responds to browser zooming and changes the background color
- 2020-03-30 04:11:57
- OfStack
//Defines a method that controls the background color of a browser page
function myfunction(){
$('body').toggleClass('bgcolor');
}
//Add methods to monitor page window changes
$(window).resize(myfunction);
//And is called when the page loads
myfunction();