Do you want to create a parallax effect on your WordPress website? The parallax scrolling effect is a design effect that makes the background image scroll down slower than the foreground content. Returns your string or array if contains. Returns scroll instance (position, limit, speed, direction, and current in-view elements). Keep in mind this will also be affected by the lerp unless you set disableLerp to true.ĭisableLerp ( boolean) : Lerp effect won’t be applied if set to true Defaults to 1000Įasing ( array) : An array of 4 floats between 0 and 1 defining the Bezier curve for the animation’s easing. 100 if you want to scroll 100 pixels above your target callback ( function) : Called when scrollTo completes (note that it won’t wait for lerp to stabilize) duration ( integer) : Defines the duration of the scroll animation in milliseconds. Available values are: offset ( integer) : Defines an offset from your target. Available values types are : node : a dom element string : you can type your own selector, or use values "top" and "bottom" to reach scroll boundaries int : An absolute scroll coordinate in pixels options (optional, object) : Settings object. Target: Defines where you want to scroll. Must Read: A Plugin For jQuery To Create A Parallax Page With A Cool Effect Method Starts and stops at data-scroll-target position. A negative value will reverse the direction.Įlement’s parallax direction. Percent is relative to viewport height, otherwise, it’s absolute pixels.Įlement parallax speed. Splitting your page into sections may improve performance.Įlement in-view trigger offset : bottom,topįirst value is bottom offset, second (optional) is top offset. Required for basic styling.ĭefines a scrollable section. (Optional) Useful if you want to scope your element and get the progress of your element in the viewport for example.ĭefines the scroll container. Must Read: A Lightweight Parallax Scrolling Effect Using jQuery Plugin | paroller.js Attribute Useful if you use transitions with native scrolling, otherwise we advise setting it to false if you don’t want to break History API’s scroll restoration feature. Sets history.scrollRestoration = 'manual' and calls window.scrollTo(0, 0) on locomotive-scroll init in Native Class. It can be useful if your page changes a lot between contexts and you want to reset everything. You can specify: smoothdirectionhorizontalGestureFor tablet the context you can also define breakpoint ( integer, defaults to 1024) to set the max-width breakpoint for tablets.Īllows to reload the page when switching between desktop, tablet and smartphone contexts. Object allowing to override some options for a particular context. With this option set to true, it listens to the whole document instead.ĭefines which gesture direction(s) scrolls in your instance. Multiply touch action to scroll faster than finger movement.īy default locomotive-scroll listens for scroll events only on the scroll container ( el option). The factor applied to the scroll delta, allows to boost/reduction scrolling speed (regardless of the platform).īoost the scrolling speed of Firefox on Windows. If false, a scrollbar will be appended to the body. Specifies the container element for the scrollbar to be appended in. Use a numeric value for absolute pixels unit.Īn object defining the initial scroll coordinates on a smooth instance. Use a string with % to use a percentage of the viewport height. Must Read: Responsive Fullscreen Draggable Image Parallax Slider With jQuery Optionĭata attribute prefix ( data-scroll-xxxx). import LocomotiveScroll from 'locomotive-scroll' Įl: document.querySelector(''), Installation: npm install locomotive-scroll Must Read: Javascript/jQuery Plugin for Simple Parallax Effects Animation | xcroller How to make use of it:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |