Looking to use jQuery to detect the window size and adjust CSS based on different resolutions? Here's a simple structure to get you started:
$(document).ready(function(){
function checkWidth() {
var windowSize = $(window).width();
if ( windowSize > 600 ) {
console.log('600px - 768px');
} else if ( windowSize > 450 ) {
console.log('450px - 600px' );
} else if ( windowSize > 300 ) {
console.log('300px -450px' );
}
}
// Run upon page load
checkWidth();
// Add event listener
$(window).resize(checkWidth);
});
The issue lies in setting up three conditions for windowSize (300px-450px, 450px-600px, 600px-768px) and mapping them correctly. Still figuring out how to solve this dilemma.