javascript - When did affix class change back to affix-top in bootstrap? Please help, still waiting -


i have right widget id rightsidewidget.

<div data-spy="affix"  id="rightsidewidget" >      // code here </div> 

i set js this:

if ($('#rightsidewidget').length > 0) {     var         topoffset = $('#rightsidewidget').offset().top;          $('#rightsidewidget').affix({             offset: {                 // want rightsidewidget affixed when it's 110px                 // page top, because have fixed navbar @ top                 // has 110 px height                 top: topoffset - 110             }         })         .on('affixed-top.bs.affix', function() {             window.console.log($(window).scrolltop());         }); } 

this code works fine, rightsidewidget has class affix-top when page load, , when it's 110px page top, class change affix-top affix, expected.

please check video here, remember scroll down view class change:

but when scroll up, rightsidewidget's class affix didn't change affix-top when it's 110px page top.

what did:

i console log point change affix-top, around 55px, please check video.

what want:

i want rightsidewidget change affix-top become affix, in case, 110px.

i know how set class manually when rightsidewidge it's 110px page top via jquery, think it's not designed make people manually, bootstrap affix should works fine itself.

so idea why happening?

thanks.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -