Partial Scroll JS
Installation
Step 1
Link the required files.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script src="js/jquery.partialScroll.js"></script>
Step 2
Creating HTML.
<div class="partialscroll"> <div class="section"></div> <div class="section"></div> <div class="section"></div> <div class="section"></div> </div>
Step 3
Creating CSS.
html, body { width: 100%; height: 100%; overflow: hidden; } .partialscroll { width: 1920px; height: 980px; }
Step 4
Call the partialScroll
method.
$(document).ready(function () { $('.partialscroll').partialScroll(); });
Options
General
$('.partialscroll').partialScroll({ mode: 'vertical', // ['vertical', 'horizontal'] / κ°λ‘, μΈλ‘ λͺ¨λ secWidth: 0, // INTEGER / μ€ν¬λ‘€ μμμ κ°λ‘ λλΉ secHeight: 0, // INTEGER / μ€ν¬λ‘€ μμμ μΈλ‘ λλΉ secLength: 0, // INTEGER / μΉμ
μ κ°μ scrollingSpeed: 900, // INTEGER / μΉμ
μλ throttleScrolling: 100, // INTEGER / μ€ν¬λ‘€ μ²΄ν¬ μλ footer: false, // BOOLEAN / FOOTER μ¬μ© μ 무 globalWheel: true, // μ 체 μμμμ Mouse Wheel μ¬μ© globalSelector: 'html', // κΈ°μ€μ΄ λ μ 체 μμμ μ νμ sliderBefore: function (oldIndex, newIndex) { }, // μ¬λΌμ΄λ μ§μ sliderAfter: function (oldIndex, newIndex) { } // μ¬λΌμ΄λ μ§ν });
Public methods
moveTo
μνλ μΉμ μΌλ‘ μ΄λ (zero-based)
var slider = $('partialscroll').partialScroll(); slider.moveTo(3); // 2λ²μ§Έ νμ΄μ§λ‘ μ΄λ
silentMoveTo
μνλ μΉμ μΌλ‘ μ‘°μ©ν(μ λλ©μ΄μ μμ΄) μ΄λ (zero-based)
var slider = $('partialscroll').partialScroll(); slider,silentMoveTo(2); // 1λ²μ¬ νμ΄μ§λ‘ μ‘°μ©ν μ΄λ
moveToUp
λ°λ‘ μ μΉμ μΌλ‘ μ΄λ
var slider = $('partialscroll').partialScroll(); slider.moveToUp();
moveToDown
λ°λ‘ μλ μΉμ μΌλ‘ μ΄λ
var slider = $('partialscroll').partialScroll(); slider.moveToDown();
stopWheel
λ§μ°μ€ ν μ¬μ© μ μ§
λ§μ°μ€ ν (Mouse wheel)μ μ μΈν κΈ°λ₯λ€μ μ¬μ©ν μ μμ΅λλ€.
var slider = $('partialscroll').partialScroll(); slider.stopWheel();
startWheel
λ§μ°μ€ ν μ¬μ© κ°λ₯
var slider = $('partialscroll').partialScroll(); slider.startWheel();
stopScroll
μ€ν¬λ‘€ μ μ§
λͺ¨λ μ€ν¬λ‘€ λ©μλλ₯Ό μ¬μ©ν μ μμ΅λλ€.
var slider = $('partialscroll').partialScroll(); slider.stopScroll();
startScroll
μ€ν¬λ‘€ μμ
λͺ¨λ μ€ν¬λ‘€ λ©μλλ₯Ό μ¬μ© κ°λ₯ν©λλ€.
var slider = $('partialscroll').partialScroll(); slider.startScroll();