Coder Social home page Coder Social logo

dom-slideshow's Introduction

dom-slideshow

Examples

as a module

import DOMSlideshow from 'dom-slideshow';

in browser

Pick dist/dom-slideshow.min.js and place in your HTML:

<script src="path/to/dom-slideshow.min.js"></script>

markup

Make a wrapper <div> with height. Then place DOMSlideShow divs.

<div style="height: 500px">
	<div class="DOMSlideshow">
		<ul class="DOMSlideshow__Inner">

			<li class="DOMSlideshow__Item -zoomin">
				<div class="DOMSlideshow__ItemContent">content 1</div>
				<div class="DOMSlideshow__ItemEffect" style="background-image: url( img/1.jpg );"></div>
			</li>

			<li class="DOMSlideshow__Item -rtol">
				<div class="DOMSlideshow__ItemContent">CONTENT 2</div>
				<div class="DOMSlideshow__ItemEffect" style="background-image: url( img/2.jpg );"></div>
			</li>

			<li class="DOMSlideshow__Item -zoomout">
				<div class="DOMSlideshow__ItemContent">content 3</div>
				<div class="DOMSlideshow__ItemEffect" style="background-image: url( img/3.jpg );"></div>
			</li>

			<li class="DOMSlideshow__Item -ltor">
				<div class="DOMSlideshow__ItemContent">CONTENT 4</div>
				<div class="DOMSlideshow__ItemEffect" style="background-image: url( img/4.jpg );"></div>
			</li>

		</ul>
	</div>
</div>

There are 5 effect types. Set a modifier class to apply.

ClassName Effect
-zoomin zoom in
-zoomout zoom out
-rtol right to left
-ltor left to right
no class just fade out

then run it

new DOMSlideshow( document.querySelector( '.DOMSlideshow' ) );

if you dont want to write JS, just set data-dom-slideshow-autostart attribute. See the Basic demo.

events

See the Events demo.

dom-slideshow's People

Contributors

yomotsu avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

xeolabs wwwk

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.