Giter Site home page Giter Site logo

trendingtechnology / simpleparallax Goto Github PK

View Code? Open in Web Editor NEW

This project forked from geosigno/simpleparallax.js

0.0 1.0 0.0 79 KB

jQuery plugin to apply parallax effects on images

Home Page: https://anakao-theme.com/simpleparallax/

License: MIT License

JavaScript 100.00%

simpleparallax's Introduction

simpleParallax logo

Why use simpleParallax?

simpleParallax is a very simple and lightweight jQuery plugin that improve your website with parallax animations on your images.

Where it may be laborious to get results through other plugins, simpleParallax stands out for its ease and its visual rendering. The parallax effect is directly applied on image tags, there is no need to use background images.

Any image will fit. Try it out!

How to use it?

1. Install the plugin

Make sure jQuery library is loaded before the plugin.

Copy/paste

Simply copy/paste the below snippet just before your closing <body> tag:

<script src="jquery.js"></script>
<script src="simpleParallax.js"></script>

or use the below CDN link provided by jsDelivr.com

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/src/simpleParallax.min.js"></script>

or

Install it via Package Managers

#npm
npm install simple-parallax-jquery

#yarn
yarn add simple-parallax-jquery

#bower
bower install simpleParallax

2. Initialize the plugin

Giving the following HTML:

<img class="thumbnail" src="image.jpg" alt="image">

Simply add the following jQuery code:

$('.thumbnail').simpleParallax();

3. Settings

Find below the different settings you can apply to simpleParallax:

setting default
orientation up choose the parallax orientation effect - up, right, down or left
scale 1.2 choose the scale ratio - need to be above 1.0

You can apply these settings with the following jQuery code:

$('img').simpleParallax({scale: '1.30', orientation: 'down'});

4. Methods

Find below the different methods you can use:

destroy

$('.thumbnail').data('simpleParallax').destroy();

Good to know

  • The higher the scale setting is set, the more visible the parallax effect will be. In return, the image will lose in quality.

  • This plugin apply parallax on the image tag and not the background image. This gives you a lot of flexibility and can be added to any image.

  • You can apply simpleParallax on picture/srcset images

Author

Geoffrey Signorato

Contributing

Open an issue or a pull request to suggest changes or additions.

simpleparallax's People

Contributors

geosigno avatar

Watchers

 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.