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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lif-phone-slider

v1.1.5

Published

移动端的(无缝/响应式/滑动)轮播

Readme

适用

移动端的(无缝/响应式/滑动)轮播

效果

demo

git clone [email protected]:AngleTF/banner-js.git demo
cd demo
npm install
npm run dev

npm安装

npm install lif-phone-slider -D

ES6 或 CommonJs使用

import i1 from './images/banner-1.jpg';
import i2 from './images/banner-2.jpg';
import i3 from './images/banner-3.jpg';
//ES6
import PhoneSlider from 'lif-phone-slider';

//CommonJs
//const PhoneSlider = require('lif-phone-slider');

new PhoneSlider(
    {
        target: '.phone-slider',          //对象元素支持c3选择器
        fun: 'ease',                //动态曲线 , 默认值ease , 可选择 linear | ease | ease-in | ease-in-out
        moveTime: .5,               //移动时间 单位s
        runTime: 3,                 //总耗时   单位s
        list: [
            {
                img: i1, 
                click: function () {
                    console.log('handle click');
                }
            },
            {img: i2, href: 'https://baidu.com'},
            {img: i3, href: 'https://baidu.com'},
        ],
        btnClick: true              //是否开启点击小圆点进行切换
    }
);

script使用

声明视口

<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">

引入css

<link rel="stylesheet" href="./dist/css/phone-slider.min.css">

reset代码

body, html{
    margin:0;padding:0;
}
ul{
    margin:0; padding:0; list-style: none;
}

声明html代码

<div class="phone-slider">
</div>

引入banner.js

<script src="./dist/PhoneSlider.js"></script>

调用函数, 设置参数

window.onload = function () {
        console.log(PhoneSlider);
        new PhoneSlider({
            target: '.phone-slider',          //对象元素支持c3选择器
            fun: 'ease',                //动态曲线 , 默认值ease , 可选择 linear | ease | ease-in | ease-in-out
            moveTime: .5,               //移动时间 单位s
            runTime: 3,                 //总耗时   单位s
            list: [
                {img:'./images/banner-1.jpg', },
                {img:'./images/banner-2.jpeg', href:'https://baidu.com'},
                {img:'./images/banner-3.jpg', href:'https://baidu.com'},
                ],
            btnClick:true              //是否开启点击小圆点进行切换
        });
    }