Animate Images on Page Scroll using jQuery & CSS3

Last modified on by Karthikeyan K

In this tutorial, I am going to explain you how to animate images on Page Scroll using jQuery & CSS3.

If you have a page with few images, as you scroll down each image in that page will animate from top to bottom, bottom to top, left to right & right to left.

I have used pure CSS3 for animation & little jQuery code to trigger animation on scrolling.

Animate Images on Page Scroll - jQuery & CSS

CSS3 Code for Animation

.animated {
-webkit-transform: scale(0.3);
-moz-transform: scale(0.3);
-o-transform: scale(0.3);
-ms-transform: scale(0.3);
transform: scale(0.3);
-webkit-transition-duration: 0.3s;
-moz-transition-duration: 0.3s;
-o-transition-duration: 0.3s;
transition-duration: 0.3s;
-moz-transition-property: scale; /* Firefox 4 */
-webkit-transition-property: scale; /* Safari and Chrome */
-o-transition-property:scale; /* Opera */
.animated.bottom-to-top {
-webkit-transition-duration: 1.2s;
-moz-transition-duration: 1.2s;
-o-transition-duration: 1.2s;
transition-duration: 1.2s;
.animation_started.animated {
-webkit-transform: scale(1) translate3d(0,0,0);
-moz-transform: scale(1);
-o-transform: scale(1);
-ms-transform: scale(1);
transform: scale(1);
.left-to-right {
-webkit-transform: scale(1) translate3d(-50%,0,0);
.right-to-left {
-webkit-transform: scale(1) translate3d(50%,0,0);
.bottom-to-top {
-webkit-transform: scale(1) translate3d(0,50%,0);

JQuery Code to Trigger Animation on Scrolling

jQuery(document).ready(function ($) {

var animated_element = $('.animated');

function image_animation() {
animated_element.each(function () {
var get_offset = $(this).offset();
if ($(window).scrollTop() + $(window).height() > + $(this).height() / 2) {
setTimeout(function () {
}, 300);

$(window).scroll(function () {

$(window).load(function () {
setInterval(image_animation, 300);


The function name is image_animation(), It will be called on page scroll & after entire page loads to start animate images. After 3 seconds I have removed the animate style to prevent infinite animation.

HTML Usage

<img class="animated right-to-left" alt="Karthikeyan K -" src="jaipur.jpg" />

I hope you will like this tutorial. You can use this code in your live projects.

Please don’t forget to share and subscribe to latest updates of the blog. Comments and feedbacks are always welcome!


View Live Demo Download

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *