Sticks the scroll position to an element as you resize the browser window. For observing element behaviour in responsive designs.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.eslintrc.json
.gitignore
LICENSE
README.md
bookmarklet.js
build.js
manual-testing.html
package.json
source.js

README.md

Sticky Viewport bookmarklet

Sometimes you want to see how an element behaves across breakpoints in a responsive design, but as you resize the browser window the element moves out of the viewport. Very frustrating!

This bookmarklet lets you mark an element as being "sticky" so that is it always centered in the viewport as you resize the browser window.

Install

  1. Create a new bookmark in your bookmarks toolbar
    • Name: Sticky Viewport
    • URL: Use the code in bookmarklet.js

How to use

  1. Navigate to the page you want to use it on
  2. Click on the Sticky Viewport button in your toolbar
  3. Move your mouse over the element that want to make sticky
  4. Click on the highlighted element to make it sticky
    • Try Alt+Click if the element captures the click and prevents it from doing the sticky business
  5. Resize the browser window so the layout changes and watch the sticky element stay in the center of the viewport

License

MIT