Giter Site home page Giter Site logo

jquery.pointparallax's Introduction

jQuery.PointParallax

v. 1.0.2

PointParallax is a jquery plugin for pleasantly displacing certain elements to certain points. It supports padding block and margin elements. It does not require the description of styles for elements. Compatible with modern browsers Chrome / Firefox / Edge / Safari, some limitations may exist.

FEATURES

DEPENDENCIES

It's a plugin for the jquery framework, you need to include jquery in your scripts. it works with jQuery 1.x / 2.x / 3.x branch (slim version don't works)

  • INSTALLATION Put loading script tag after jquery script tag and loading:
<script src="jquery.pointparallax.js"></script>
  • HOW TO USE Initialize PointParallax ALWAYS in (document) ready statement.
// 1. Simple mode, it styles document scrollbar:
$(function() {  
    $('.pointparallax').pointparallax();
});

CONFIGURATION PARAMETERS

When you call "PointParallax" you can pass some parameters to custom visual aspects:

$('.pointparallax').pointparallax({
    itemsSelector: '.point__item', // Selector for moving elements.
    items: {},  // Ability to specify elements and their attributes in an array.
    itemIncludeMargin: false, // Whether to use a magrin to count the area of elements.
    position: null, // The default item position, if they do not have a position. Does not consider positioning by styles.
    autoheight: false, // Whether to change the height of a common block relative to the dimensions and positions of the elements.
    autoheightClass: 'pointparallax-autoheight', // Selector class for change the height.
    fixedClass: 'pointparallax-fixed', // Class for blocking the movement of an element. Does not affect the positioning.
    point: 'center', // The default point to which all the elements move. Default: center.
    path: 100, // The amount of path that must pass the elements to the control point. Default: Full path.
    easing: 'linear', // A string indicating which easing function to use for the transition.
});

CONFIGURATION ATTRIBUTES

For the main element:

<div
class="pointparallax"
data-point="center" <!-- The default point to which all the elements move. Default: center. -->
data-path="100" <!-- The amount of path that must pass the elements to the control point. Default: Full path. -->
data-easing="linear" <!-- A string indicating which easing function to use for the transition. -->
>
</div>

For the moving elements:

<div
class="point__item"
data-position="" <!-- The default item position. Does not consider positioning by styles. -->
data-point="center" <!-- The default point to which all the elements move. Default: center. -->
data-path="100" <!-- The amount of path that must pass the elements to the control point. Default: Full path. -->
data-easing="linear" <!-- A string indicating which easing function to use for the transition. -->
>
</div>

Copyright 2011-18 BlackSiriuS

Licensed under the GNU License, https://opensource.org/licenses/GPL-3.0

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.