bootstrap 2.3.2 affix bottom jumps between affix a

2019-07-17 07:17发布

问题:

I'm using twitter bootstrap 2.3.2 and included the affix js. The div perfectly listens to the top:500px; but has difficulties with the bottom, on reaching bottom, it switches the div name between affix and affix-bottom every pixel. Looking nineties flashy, which is nice in a way.., but not really how I would expect it. Any ideas on how to stick the bottom on the way it should be? Would make my day!!

The js:

$(".my-affix-div").affix({
  offset: {
    top: 440,
    bottom: 270
}

And the css:

.affix{
    top:60px;
}

.affix-bottom {
    bottom:270px;
    position: absolute;
    top:auto;
}

回答1:

  1. Download bootstrap 3.3.7 version.

  2. find affix.js in Js folder, add it to Ur project in script tag.

I solved my problem by this...if this helpful let me know. Thanks