The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Sticky Responsive Sidebar

  • This topic is empty.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #145715

    I have a sidebar that sits within my content, at full width I need it to follow the scroll and stop when it hits a breakpoint.

    When at tablet sizes or smaller I need it to stick to bottom of the page (so it’s always seen) and when it hits a breakpoint return to the normal flow of the document.

    For example from position: fixed; to position: relative.

    I’ve created a CodePen here with the basic markup, have no idea how to execute my idea in Javascript.

    Any help is appreciated.

    Thanks in advance!


    This is in the wrong place, it should be in CSS Combat.

    Anyway, why do you want to use javascript. Your code seems to be working fine. This is exactly what media queries are for.

Viewing 2 posts - 1 through 2 (of 2 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.