I use scrollToFixed.js for scroll my div with fix postion .but I want to when I see the page in mobile device I remove position fix when I scroll to bottom of page.how I can do it?I write some code but it does not work correctly.
<div class="header" style='height:50px;border:1px solid;'></div>
<div class="container-fluid">
<div class="row">
<div class="col-md-3 col-sm-4">
<div class="profileRight" style='height:550px;border:1px solid;'>
name:Jack
</div>
</div>
<div class="col-md-9 col-sm-8 profile-info">
<div style='height:1550px;border:1px solid;'>
content</div>
</div>
</div>
</div>
$( '.profileRight' ).scrollToFixed( {
marginTop: $( '.header' ).outerHeight(),
limit: function () {
var limit = $( '.footer' ).offset().top-480;
return limit;
}
} );
$( document ).scroll( function () {
var winWidth = $( window ).width();
if ( winWidth < 767 ) {
$( '.profileRight' ).css( "position", "static" );
}
} );