GithubHelp home page GithubHelp logo

drkx / bounce Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 2.0 21 KB

Simple demonstration of how you can setup a JavaScript library

License: GNU General Public License v3.0

JavaScript 100.00%

bounce's Introduction

bounce

Simple demonstration of how you can setup a JavaScript library

Synopsis

A small library that can make a an element of your choosing bounce

Code Example

The easiest way to use bounce is putting it in a variable and calling the init function on it. It will than target the element with class bounce on it

//Initialize the first object without params so the default values are used
var bounce = Bounce();
bounce.init();

If you want however you can use a custom selector and change the gravity and the update speed using a settings object

//Initialize the second object with a different selector and a gravity of only to so it goes...much...slower
var bounce2 = Bounce();
bounce2.init('.bounce2', {gravity: 2, updateSpeed:2});

Demo

See bounce demo

Motivation

This library was created as a small example on how you can create a library.

Installation

Just download bounce.js, put it in the head of your page and call it. Make sure the parent of the targeted element has a hight otherwise there's not much room to bounce

API Reference

init

Parameters Type Optional Description
selector string true Css selector that targets the element that needs to bounce
settings object true Object containing settings gravity and/or updateSpeed

bounce's People

Contributors

drkx avatar

Watchers

 avatar

Forkers

ajaganjac ccdh

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.