1

How to make that when scrolling to the div in which there is animation and then animate worked? It is my div:

   <div class="otsenka-bottom-c ">
     <div class="otsenka-bottom-cl">
       <h3><b>ОБРАЩАЙТЕСЬ К НАМ, ЕСЛИ</b></h3>
       </div>
       <div class="border-black"></div>
        <div class="otsenka-bottom-cb">
            <div class="otsenka-bottom-block" >
            <div class="otsenka-bottom-block-p an-1" style="position:relative; left:-200%">
            <div class="align-middle" style="text-align:right;width:65%;">
               <h3><b>LOREM IPSUM</b></h3>
                <ul><li style="text-align:right; color:#000;">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Minima itaque neque fugit rem, in praesentium, est. </li></ul>
            </div>
            <div class="align-middle" id="ellipse">
                <img src="assets/img/ellipse.png" class="img-responsive">
            </div>              
            </div>
       </div>
     </div>
   </div>

What should I write instead of hover??? Who know, help me please?! It is my function:

function Animate() {
  if ($(window).width() >= 414) {
    $('.otsenka-bottom-c').hover(function() {
      $(".centre").animate({
        top: "0px",
        opacity: 1
      }, 1000, function() {
        $(".an-1").animate({
          left: 0
        }, 1500);
      });
    });
  } else {
    $(".centre").css({
      top: "0"
    });
    $(".an-1").css({
      left: "0"
    });
  }
}
Animate();
justDan
  • 2,302
  • 5
  • 20
  • 29
Abzal
  • 19
  • 3
  • I'm not really sure what you're asking. I'm taking it English isn't your first language? Could you try rewording your first sentence? – DavidBittner Jul 24 '17 at 18:40
  • I'm hearing "how can i trigger an animation on an element as its scrolled into view"... Is this what you are looking for Abzal? – Stuart Jul 24 '17 at 18:45
  • 1
    @Stuart yes, Stuart. This is what I'm looking for – Abzal Jul 24 '17 at 18:53
  • 1
    @DavidBittner how can i trigger an animation on an element as its scrolled into view? =) – Abzal Jul 24 '17 at 18:53
  • https://stackoverflow.com/questions/34270530/animating-elements-when-they-are-in-the-viewport and https://stackoverflow.com/questions/22738674/trigger-an-event-each-time-an-item-scrolls-into-viewport – Stuart Jul 24 '17 at 18:56
  • @Abzal Right okay that makes sense! You would want to do a check if it is within the current viewport. I think this post may help you out better: https://stackoverflow.com/a/7557433/5628 – DavidBittner Jul 24 '17 at 18:56
  • 1
    @DavidBittner Thank you very much!!! – Abzal Jul 24 '17 at 19:14
  • 1
    @Stuart Thank you very much!!!!!!! – Abzal Jul 24 '17 at 19:15
  • 1
    Done with your help =) – Abzal Jul 24 '17 at 19:16

0 Answers0