Giter Club home page Giter Club logo

jquery.parallax-scroll's Introduction

jquery.parallax-scroll ⛔️ DEPRECATED

Smooth parallax animations on vertical page scrolling using requestAnimationFrame and CSS3 3D transitions.

Browser Support

Chrome 30+, Firefox 34+, Safari 7.1+, IE 10+

How to use

Insert the script jquery.parallax-scroll.js in your page after jQuery (and jquery.easing.1.3.js if needed), there is no more javascript code required.
Add the attribute 'data-parallax' to the dom elements you want with a json syntax that contains optionnals parameters and properties you want animate.

Parameters

  • from-scroll: vertical scroll position the animation starts (default: when the element is visible)
  • distance: distance on vertical scroll position the animation will last (default: the window visible height)
  • to-scroll: vertical scroll position the animation ends (default: from-scroll + distance)
  • smoothness: factor that slowdown the animation, the more the smoothier (default: 30)
  • perspective: 3d perspective applied on parent element in case of z axe use (default: 800)

  • easing: Easing function used to animate (note that the duration parameter is needed, distance and to-scroll will be ignored) - jquery.easing.1.3.js is required to use the optionnal feature.
  • duration: Duration of the easing animation, will be ignore if there is no easing paramater specified (frames)
  • easing-return: Easing function for the return, when you scroll up (default: easing)
  • duration-return: Duration for the return (default: duration)

Properties

  • x: X axis translation (pixels)
  • y: Y axis translation (pixels)
  • z: Z axis translation (pixels)
  • rotateX: X axis rotation (degrees)
  • rotateY: Y axis rotation (degrees)
  • rotateZ: Z axis rotation (degrees)
  • scale: Global scale (ratio)
  • scaleX: X axis scale (ratio)
  • scaleY: Y axis scale (ratio)
  • scaleZ: Z axis scale (ratio)

Multiple animations

You can now increment data-parallax attribute to setup multiple animations:
- data-parallax
- data-parallax2
- data-parallax3
- data-parallax...

Examples

Move down the image by 230 pixels while vertical scrolling from when it shows up on screen bottom to when it disappears on screen top:
<img src="img/paris.jpg" alt="Paris" data-parallax='{"y" : 230}'/>

Translation to the right by 650 pixels with a lower smoothness effect when vertical scroll position is over 50 pixels:
<li data-parallax='{"x": 650, "from-scroll": 50, "distance": 0, "smoothness": 10}'>1</li>

Translation to the right by 650 pixels when vertical scroll position is over 90 pixels, then translation to the bottom by 500 pixels when vertical scroll position is over 400 pixels during a scroll distance of 60 pixels
<li data-parallax='{"x": 650, "from-scroll": 90, "distance": 0}' data-parallax2='{"y": 500, "from-scroll": 400, "distance": 60}'>3</li>

Rotation by 1000 degrees along the X axis from when the exclamation point shows up to the window height distance scroll position:
<p data-parallax='{"rotateX":1000}'>!</p>

jquery.parallax-scroll's People

Contributors

alumbo avatar luizreginaldo avatar mhrabiee avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery.parallax-scroll's Issues

Parallax for background-image based

Hi,
as many hero section use a background image, you should make an option to make it available for them.
It use the background-position property

Cheers !

Great plugin! Making it work for mobile?

Hi,

Love this plugin it is exactly what I needed!

The only issue is I can't figure out how to make it responsive. I'm not attached to having the images remain parallax on touch screens so if I can just disable the plugin this is fine too.

Thanks,
Matt

Issue with Jquery3 with multiples data-parallax=

Hello,

I have some issues with your plugin on the last version of Jquery (3.1.1 minified), it's not possible to use multiple instances like :

<img data-parallax='{"y": 300, "x": -575, "from-scroll": 10, "easing": "easeOutElastic", "duration": 300, "rotateY":360}' data-parallax2='{"y": 600, "x": 400, "from-scroll": 500, "easing": "easeOutElastic", "duration": 300, "rotateY":360}' class="img-responsive center-block" src="images/logo.png" alt="logo" />

I got this error in debug mode :

jQuery.Deferred exception: data is undefined ParallaxScroll._onScroll/<@http://localhost/project/assets/js/parallax.min.js:66:21
.proxy/e@http://localhost/project/assets/js/jquery-3.1.1.min.js:2:3653
.each@http://localhost/project/assets/js/jquery-3.1.1.min.js:2:2813
r.prototype.each@http://localhost/project/assets/js/jquery-3.1.1.min.js:2:1001
ParallaxScroll._onScroll@http://localhost/project/assets/js/parallax.min.js:44:9
ParallaxScroll.init@http://localhost/project/assets/js/parallax.min.js:28:9
@http://localhost/project/assets/js/parallax.min.js:2:5
g/</j@http://localhost/project/assets/js/jquery-3.1.1.min.js:2:29946
g/</k<@http://localhost/project/assets/js/jquery-3.1.1.min.js:2:30262
undefined

Do you have any solution ?

Thank you very much for your work.

Regards,

execute custom function

it would be possible execute a function the beginning animation and another function to end of the animation? or also on start reverse animation

it would be useful to have two dedicated parameters for single element (example data-parallax-onStart="function" data-parallax-onEnd="function")

Different scrollable DOM

It would be awesome if it was possible to pass the scroll element to watch. My app should use this effect in a part that is not the whole viewport but a column. It would be cool to be able to specify this parent column.

For Option Extend.

I think it will be more pretty if have more option like.

1.. On scroll background Opacity Change
2.. On scroll background Color Change

Disable Temporarily on Mobile Version

Hello, is it possible to disable temporarily only on mobile version,
ex:
if(screen.width > 1024) { ParallaxScroll.init(); } else { $('.myclass').removeAttr("data-parallax"); }

how we can remove the data-parallax attribute temporarily and set it back once the screen width is more than 1024px?
seems the ParallaxScroll.init() not trigger the removed attribute back.
Any idea will be appreciated! Big Thanks :)

Preserving Transform Properties

First off, just want to say that this is an excellent plug-in. Much smoother than most parallax effects.

I would like to know how it would be possible to preserve existing transform properties set in CSS (skew, for example), so that they are not over written with the parallax scroll plugin.

If you check the star example you can see that the stars are transformed via CSS styling until the page is scrolled and the plugin is triggered. At which point, the stars which were previously rotated are reset. Any ideas? Thanks!

Deprecated

Hello, why has the plugin been signed as “deprecated”. Works still very well for me. Did I miss something? Thank you!

Disable for mobile

Hi,

I would like to know if it's possible to disable the parallax for mobile/tablet device ?

Thank you in advance

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.