Code Monkey home page Code Monkey logo

jquery-timelify's Introduction

jquery-timelify

A little plugin I've made to create simple timeline

Example

Here is an example of what you can do with this plugin :

Usage

Simply clone this repository or download it to see an example of how your HTML structure should be.

You have to include the css files (timelify.css and FontAwesome, which comes bundled in this plugin). I also use Animate.css, for providing these greate animations ! After you imported your stylesheets, juste import jQuery and jquery.timelify.js, and you're ready !

Then, to initialize the plugin, you must have jQuery, then simply select your element (generally .timeline) and use the timelify() function.

Customizing

Because I'm using SCSS, you can easily custom the look and feel of your timeline. Simply edit variables in _variables.css to change for example the color of block, or the color of the vertical bar and background of h2.

You can also customize what animations you prefer to use. When calling the timefly() method, you can pass an object litteral to define settings.

Available settings are :

Settings Default value Possible values
animLeft bounceInLeft any valid Animate.css animations
animRight bounceInRight any valid Animate.css animations
animCenter bounceInUp any valid Animate.css animations
animSpeed 600 duration of animation (in ms)
offset 150 offset, in px at which blocks start to show

Each of these settings will modify how left, right, and centered blocks will appear.

Example

Suppose you have an HTML who looks like this :

   
<div class="timeline">
   	<h2>2013</h2>
   	<ul class="timeline-items">
   		<li class="is-hidden timeline-item">
   			<h3>Title</h3>
   			<hr>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Amet cupiditate, delectus deserunt doloribus earum eveniet explicabo fuga iste magni maxime mollitia nemo neque, perferendis quod reprehenderit ut, vel veritatis voluptas?</p>
   			<hr>
   			<time>Date</time>
   		</li>
   	</ul>
   	<h2>2014</h2>
   	<ul class="timeline-items">
   		<li class="is-hidden timeline-item">
   			<h3>Title</h3>
   			<hr>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci alias aspernatur consequuntur culpa deserunt ea esse est inventore, ipsa laborum officia, quam quia quidem, rem sunt tempora tenetur ullam voluptatem.</p>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Dicta dolore harum iure quod ut! Accusamus aspernatur corporis est excepturi facere laudantium nesciunt nihil optio, quaerat quos rerum sunt suscipit voluptate?.</p>
   			<hr>
   			<time>Mars 2014</time>
   		</li>
   		<li class="is-hidden timeline-item centered">
   			<h3>Title</h3>
   			<hr>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis, cupiditate dicta dignissimos dolorem doloribus ducimus eos error ex molestiae nobis odio odit optio placeat quasi repudiandae, unde velit voluptate voluptatem!
   			</p>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ab commodi consectetur cupiditate ea, eius excepturi expedita illum, incidunt ipsam iste modi obcaecati optio repellendus! Dolore dolores pariatur sint veniam voluptates!</p>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Adipisci consequatur distinctio doloremque eos eum eveniet fuga molestiae mollitia nesciunt nisi nobis nostrum, odio omnis pariatur praesentium quibusdam sequi sint voluptates.</p>
   			<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. A aliquam, aspernatur commodi consequuntur corporis dicta, distinctio enim eos expedita, id iste laborum maxime nesciunt quaerat sed temporibus veniam vero voluptatem.</p>
   			<p><a
   					href="http://gamejolt.com/games/slender-the-cursed-forest/30950">Link</a>
   			</p>
   			<hr>
   			<time>Date</time>
   		</li>
   
   	</ul>
</div>
   	
   

Simply do $('.timeline').timelify()

Or if you want to customize, for example, how it appear from the right, and the center, you could do :

    $('.timeline').timelify({
        animRight: "fadeInRight",
        animCenter: "zoomIn"
    })

You have to keep the same HTML structure as the example above.

jquery-timelify's People

Contributors

liinkiing 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.