Grow your CSS skills. Land your dream job.

sticky button that stops at div

  • # July 14, 2013 at 8:47 am

    Hi,
    I’ve created a fixed position button that locks to the left and follows scroll but I want it to stop scrolling before the contact form/footer appears. Ideally I’d love to solve the problem with CSS but can’t work out how. A quick search on google told me that I have to use some javascript. Taufik Nurrohman’s JS script seems to deal with this problem but I can’t work out how to make it work. [Here’s the codepen link](http://codepen.io/bbilander/full/diGjx “codepen link”). Any ideas?
    Thanks in advance!
    B

    # July 14, 2013 at 10:45 am

    Like this is the only way I know of. Unless I’m missing something this is not possible with CSS. http://www.websitecodetutorials.com/code/jquery-plugins/sticky-js-position-fixed-at-certain-point-in-page-demo.php

    # July 14, 2013 at 6:53 pm

    Thanks PicnicTutorials but that link you’ve sent me doesn’t seem to have a “stop” point. I want the button to stick to the left until a certain point. Then I want it to stop. The javascript I’ve put in should do this but it doesn’t seem to work with the CSS semi-circle I’ve used. Perhaps I should try an img instead?

    # July 15, 2013 at 3:16 am

    Try waypoint js to

    $(‘yourfooter’).waypoint({
    handler: function(direction) {
    // do stuff to the circular thingy
    },
    offset:100%
    });

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".