js带滚动惯性的视觉差特效插件 -JS/jQuery代码 -演示与下载 -时代Java

js带滚动惯性的视觉差特效插件 Inertia scroll and parallax effect plugin in Vanilla.js

L
u
x
y
.
j
s

Inertia scroll and parallax effect plugin in Vanilla.js

Installation

You can install it using npm:

npm install luxy.js --save

Or just include the script in your page:

<script src="path/to/luxy.js" charset="utf-8"></script>

Included luxy.js in your project and initialize:

<script charset="utf-8">
    luxy.init();
</script>
fog
fog02

Usage

Wrap the entire content with the element specified in the wrapper option. Please exclude fixed elements.

<div id="luxy">
    ... Entire content
</div>

Add .luxy-el to the element for which parallax effect is to be specified.

<div id="luxy">
    <div class="luxy-el"></div>
</div>

Specify the speed of the parallax effect with the data-speed-y attribute and offset with the data-offset attribute.

<div id="luxy">
    <div class="luxy-el" data-speed-y="5" data-offset="-50"></div>
</div>

If you want to move horizontally, specify data-horizontal="1" and specify the speed in the horizontal direction with the data-speed-x attribute.

<div id="luxy">
    <div class="luxy-el" data-horizontal="1" data-speed-x="-5"></div>
</div>

Options

Name default description
wrapper '#luxy' Entire content wrapper element.
targets '.luxy-el' Parallax effect targets elements.
wrapperSpeed 0.08 Inertia scroll speed.
下载代码说明
X关闭

js带滚动惯性的视觉差特效插件luxy.js

luxy.js是一款js带滚动惯性的视觉差特效插件。该插件可以在页面中制作图片HTML内容滚动视觉差特效,并且在页面滚动时,带有惯性效果,非常炫酷简单,需要的朋友可下载!该js带滚动惯性的视觉差特效插件的github地址为:https://github.com/min30327/luxy.js本代码适用浏览器:搜狗、360、FireFox(建议)、Chrome、Safari、Opera、傲游、世