Hi,
I try to change the background color of a page depending on the size of the window.
In CSS Inline of the page I wrote
@media (max-width ≤640px) {
body {
background-color: red;
}
}
@media (min-width >640) and (max-width <768px) {
body {
background-color:yellow;
}
}
@media (min-width ≥768px) and (max-width <992px) {
body {
background-color:orange;
}
}
@media (min-width ≥992px) and (max-width <1200px) {
body {
background-color:green;
}
}
@media (min-width ≥1200px) {
body {
background-color: purple;
}
}
On Execute when page laods I wrote
apex.jQuery( window ).on('apexwindowresized', function() {
if ( apex.theme42.util.mq( '(min-width: 640px)' ) ) {
console.log( 'Window resized, and viewport is at least 640px wide' )
}
});
But I can change the size of the window, nothing happens the background is always white. but once the console .log is written when I use F12 Button
Thank you for your help
Regards
Siegwin