Answers for "locomotive scroll js"

1

locomotive scroll

<head>
	<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.css">
</head>


<div id="scrollContainer" data-scroll-container="''" class="scrollcontainer">

     <div data-scroll-section="''" class="scroll-section"> //its your choice use section or div but don't style this sec or div

  </div>     
     
</div>     

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.min.js"></script>
<script>
     $(window).load(function() {
            const scroller = new LocomotiveScroll({
                el: document.querySelector("#scrollContainer"),
                smooth: true
               // multiplier: 2,
//lerp: 0.1
               
            });
});
</script>
Posted by: Guest on August-17-2021
0

locomotive scroll

//In Header
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.css">

//In body
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/locomotive-scroll.min.js"></script>

<script>
     $(window).load(function() {
            const scroller = new LocomotiveScroll({
                el: document.querySelector("#scrollContainer"),
                smooth: true
               // multiplier: 2,
//lerp: 0.1
               
            });
});
</script>
Posted by: Guest on August-17-2021

Browse Popular Code Answers by Language