Skip to content

usama-gh/Shopables-Frontend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

page-slider-js

A page slider in vanilla JS. Made famous by Apple.com a good while ago. I made this because I couldn't find a decent one in pure vanilla javascript. Oh, it's also responsive.

The script will add the ID selector of each slide to the URL when you scroll to it. When the page loads and a valid hash is in the URL, the script will scroll to that slide.

Update July 21, 2019: Exposed to the function to move to a spesific slide so that you can create custom links.

Initiate

Point the function to the element which contains the slides:

<script>
  var mySlider = slider('.slides');
</script>

To create custom links, do something along the lines of:

<a href="javascript:mySlider.gotoSlide('#target');">Click me please</a>

Preview

Compability

Tested working in all modern desktop, tablet and mobile browsers, even including IE10 and up.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 42.7%
  • CSS 36.6%
  • JavaScript 14.5%
  • SCSS 5.4%
  • PHP 0.8%