Is it possible to include a window resize function in this code?
jQuery(document).ready(function($){
var $MyDiv1 = $('#mydiv1');
if ($MyDiv1.length && $MyDiv1.css('position') == 'fixed') {
console.log ( '#mydiv1 is fixed' );
} else {
console.log ( '#mydiv1 is not fixed' );
}
});
The current setup only works if the page is refreshed after resizing. I would like to continuously check whether MyDiv1's position is fixed or not while the window is being resized. Any help would be appreciated. Thank you.