Giter Site home page Giter Site logo

carousel-image's Introduction

carousel-image

轮播图片,支持触摸滑动。 例子见DEMO
预览效果: #使用方法案例: <script type="text/javascript" src="../src/zepto.js"></script> <script type="text/javascript" src="../src/carousel-image.js"></script> <script> $('.carousel-image').CarouselImage({ num :$('.carousel-num') }); </script> ##或者requirejs:

<script type="text/javascript" src="../src/zepto.js"></script> <script type="text/javascript" src="../src/require.js"></script> <script> requirejs.config({ //By default load any module IDs from js/lib baseUrl: '../src', paths: { $: 'zepto' } }); require(['carousel-image','$'], function(CarouselImage,$) { var cs = new CarouselImage(); cs.init({ target:$('.carousel-image'), num:$('.carousel-num') }); }); </script> #API 属性、方法及回调: ##target: 表示是在这个容器内的元素会触发事件,它应该有个子级的容器,方便动画的优化 ##num: 本意是以显示当前索引的数字表示,但现在用样式把数字隐藏了,如果要显示数字样式,可自行更改样式文件 ##width: 宽度 (如果不设置将按第一张加载完成的图片的大小来等比压缩显示) ##height: 高度 (如果不设置将按第一张加载完成的图片的大小来等比压缩显示) ##timer: 动画延时 ##animate : 动画时间

carousel-image's People

Contributors

tianxiangbing avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.