Code Monkey home page Code Monkey logo

scroll-mark's Introduction

Scroll Mark

Problem

Often, it's easy to lose your place on a webpage when scrolling - especially text-heavy pages without obtrusive anchors. Generally you relocate your position quickly, but it's an unnecessary annoyance. Smooth-scrolling homogenizes everything while moving, often resulting in eye flickering/strain. Non smooth-scrolling prevents this, but makes large jumps which can throw off focus.

Solution

Animate a visual anchor to help positional tracking

Setup

  • Import scroll-mark.css and scroll-mark.js to your project
  • Reference in your html
  • Will automatically act on <body> if it overflows in y
  • Add .scroll-mark to other scroll containers if desired
  • Modify variables and styles if needed

Options

./scroll-mark.js

  • scrollm.config.delay Time between scroll events. Under will be 1 continuous event. Over will end first, and start fresh
  • scrollm.config.offset Beginning height for scroll mark. Adjust if you want it higher/lower (relative to scroll direction)

TODO

  • Console notification if class added to the wrong element
  • Console notification if not automatically acting on <body>
  • BUG: flicks to wrong side when switching scroll target
  • Test with different styling cases

scroll-mark's People

Contributors

nicfontaine avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.