-1

I have been struggling with this for some time now.

Basically I have a website and I will show some images and I want them to animate one by one. I have added the animate.css I found on internet and added to my website.

This is my HTML:

<!-- START Column 1 -->
        <div class="one-third column">
            <div class="img-wrp animated rotateIn" data-delay="100">
                <a href="#"> <img alt="" class="scaleimg" src="images/photo.jpg" /> </a>
                <div class="overlay-wrp">
                    <div class="overlay"> </div>
                </div>
            </div>
            <h3> Title 1</h3>
          <p class="job position">Podnaslov </p>
            <p class="description"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus non leo nec enim ultricies convallis. Quisque tempus, lorem in rutrum vulputate, elit justo placerat neque, sed iaculis diam nisl vel sapien. Donec facilisis in lectus non adipiscing. Sed molestie scelerisque. </p>
        </div>
        <!--END Column 1 -->


        <!-- START Column 2 -->
        <div class="one-third column">
            <div class="img-wrp animated rotateIn" data-delay="500">
                <a href="#"> <img alt="" class="scaleimg" src="images/photo.jpg" /> </a>
                <div class="overlay-wrp">
                    <div class="overlay"> </div>
                </div>
            </div>
            <h3> Title 2</h3>
          <p class="job position">Podnaslov </p>
            <p class="description"> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus non leo nec enim ultricies convallis. Quisque tempus, lorem in rutrum vulputate, elit justo placerat neque, sed iaculis diam nisl vel sapien. Donec facilisis in lectus non adipiscing. Sed molestie scelerisque. </p>
        </div>
        <!--END Column 2 -->

What I want to achieve is to animate images one by one, for example first one shows after one second, second one after 2 seconds and so on. I'm not so good with .js so if anyone could help me with this.

And how can I make it as I scroll down images appear, but not before someone scrolls down to that part of web page?

Thanks a lot! Cheers!

user3727784
  • 17
  • 2
  • 7

1 Answers1

0

I found a fiddle online that showed a good example of what you wanted. I updated it and changed a few things, that can be found below.

The key to all of this is the following code:

  $(function() {
      $("img").lazyload({
          effect : "fadeIn",
          effectspeed: 10000 
      });
  });

All this does is set a 10 second delay for the user to view the photo... Honestly, you don't need it to be that long but you can always play with it. You also need to make sure you follow the instructions completely in order to use the lazy load plugin that I had mentioned in the comments above.

Side Note:

You can find a few helpful hints here or here (just Google Lazy Load).

JSFIDDLE

Community
  • 1
  • 1
BuddhistBeast
  • 2,652
  • 2
  • 21
  • 29