npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

orijs-parallax

v1.0.3

Published

This is a roll parallax plugin

Downloads

10

Readme

parallax

这是一个原生js写的视觉差插件

npm安装

npm install orijs-parallax --save

H5页面中正常引入JS文件即可

vue中引入及使用(在需要使用的页面引入)

同一个类名可以绑定一个元素或者多个元素(使用一下方法的时候不写绑定,就需要在页面元素写入默认类名parallax_el即可)

绑定的元素类名没有限制(可自定义类名)。

import 'orijs-parallax/js/parallax.js'
or
import 'orijs-parallax/js/parallax.min.js'
var parallax = new parallax(['.parallax_el','.parallax_el2']);

或者

import parallax from "orijs-parallax";
window.parallax(['.parallax_el','.parallax_el2'])

注意:当绑定一个元素的时候以下是可以单独设置的

data-direction: 设置这个元素的滚动方向(默认为down,可设值down,up这两个,设置up时与页面滚动方向相反)
data-duration:  设置这个元素滚动时持续的时间(默认为0)
data-speed: 	设置这个元素滚动的速度(默认为0,这个要设置正整数,数值越大滚动就越慢,滚动的距离就越小)

注意

  • 1:绑定元素的父元素要设置相对定位position:relative;

  • 2:绑定元素不要设置内联样式,就是不要在绑定元素标签上设置样式,可在样式文件里面设置你需要的样式

  • 3:在样式文件中绑定的元素必须设置绝对定位position:absolute;left或者right自行设置,不要设置top或者bottom

  • 4:绑定元素里面可用背景图,设置图的宽高,就不会使真实图片变形,且高度要设置到这个盒子内容高度的200%以上,不然不够高度滚动,滚动时这个背景就会有空白。

示例