Below is the script I am working with:
$(window).resize(function(){
if ($(window).width() >= 992){
var windw = this;
$.fn.followTo = function ( pos ) {
var $this = this,
$window = $(windw);
$window.scroll(function(e){
if ($window.scrollTop() > pos){
$this.css({
position: 'static',
top: pos,
marginTop: 100
});
}
else {
$this.css({
position: 'fixed',
top: 100
});
}
});
};
$('#bgForm').followTo(1550);
}
});
I am looking to prevent the position from being fixed when the browser size is below 992px. Is there a way to achieve this using my current script? I have attempted with the provided code, but the element gets stuck in position. Thanks in advance!