@abernier/parallax 中文文档教程
//ax
DEMO:https
INSTALL
://bl.ocks.org/abernier/raw/a67f6f78721b152c004c759ebb4387c4/客户端:
import Parallax from 'https://unpkg.com/@abernier/parallax@1.0.2'
或通过打包器:
import Parallax from '@abernier/parallax'
注意:你必须 yarn/ npm install 之前
Usage
看:index.html
<section>
<div data-parallax-dy="0">A</div>
<div data-parallax-dy=".1">B</div>
<div data-parallax-dy=".2">C</div>
<div data-parallax-dy=".3">D</div>
<div data-parallax-dy=".4">E</div>
<div data-parallax-dy=".5">F</div>
<div data-parallax-dy=".6">G</div>
<div data-parallax-dy=".7">H</div>
<div data-parallax-dy=".8">I</div>
<div data-parallax-dy=".9">J</div>
<div data-parallax-dy>K</div>
</section>
<script type="module">
import Parallax from 'https://unpkg.com/@abernier/parallax@latest'
new Parallax(document.querySelector('section'))
</script>
//ax
DEMO: https://bl.ocks.org/abernier/raw/a67f6f78721b152c004c759ebb4387c4/
INSTALL
client-side:
import Parallax from 'https://unpkg.com/@abernier/parallax@1.0.2'
or via a bundler:
import Parallax from '@abernier/parallax'
NB: you must yarn/npm install it before
Usage
see: index.html
<section>
<div data-parallax-dy="0">A</div>
<div data-parallax-dy=".1">B</div>
<div data-parallax-dy=".2">C</div>
<div data-parallax-dy=".3">D</div>
<div data-parallax-dy=".4">E</div>
<div data-parallax-dy=".5">F</div>
<div data-parallax-dy=".6">G</div>
<div data-parallax-dy=".7">H</div>
<div data-parallax-dy=".8">I</div>
<div data-parallax-dy=".9">J</div>
<div data-parallax-dy>K</div>
</section>
<script type="module">
import Parallax from 'https://unpkg.com/@abernier/parallax@latest'
new Parallax(document.querySelector('section'))
</script>