Skip to content

Simple jquery script that allows to have a unique button that scrolls to multiple targets, based on the user's position in the webpage

Notifications You must be signed in to change notification settings

gianlucahmd/onebutton-multipletargets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

One button -> Multiple targets

A lot of websites with scrolling contentes have multiple buttons that bring you to relevant sections of the page (like this one). In some situations I really don't like it, especially when in situations with full-height widths. For this reason, I made this code JS code which allows you to have a single fixed button, that redirects your user to multiple relevant targets, based on their position the page.

Usage:

  • Import onebutton/multipletargets.js on your html.
  • Add id = 'next_button' to the button/link you want your users to click to move to your website's important sections.
  • Add class = 'target_element' to the sections you want your magic button direct your users to.

That's it! You can try it out on this codepen, or read this Medium post for in-depth explenation (if you need).

About

Simple jquery script that allows to have a unique button that scrolls to multiple targets, based on the user's position in the webpage

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published