Div that follows scroll (not position:fixed)

后端 未结 4 1813
迷失自我
迷失自我 2021-01-23 21:43

I found it sometime ago and now I can\'t. I want to find something like the shopping cart at the apple store, it\'s a div thats not positioned absolute nor fixed, for instance,

4条回答
  •  独厮守ぢ
    2021-01-23 22:40

    This demo shows exactly what you are looking for:

    http://jsfiddle.net/y3qV5/

    Here is the link to the jquery plugin that does this:

    https://github.com/bigspotteddog/ScrollToFixed

    I am assuming you are saying that you "...have no chance whatesover to code this" because you do not know javascript. Please excuse me if I assumed wrong. Here is the what you would paste into your html page:

    Here is the usage:

    
        
        
        
    
    

    Change '#cart' to whatever you have named your element.

提交回复
热议问题