Jump to content
Search Community

Léo Durand

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by Léo Durand

  1. Hi ! 

    I'm trying to add a setTimeout on hover to avoid a bug when the mouse is going fast on links.

    I tried a simple setTimeout but nothing
     

    setTimeout(function over(){
      TweenMax.to($(this).find(".title_thumb"), 0.3, {display:"block" , opacity:"1" , marginTop:"20px" , ease:Power2.easeOut , delay:"0.2"})
      TweenMax.to($(this).find(".view_thumb"), 0.3, {display:"block" , opacity:"1" , ease:Power2.easeOut , delay:"0.5"});
      TweenMax.to($(this).find(".layer_thumb"), 0.02, {opacity:"1" , ease:Power2.easeOut});
    }, 200);


    and also with this code but didn't find to make it work...

     

    $(document).ready(function(){
        var delay=200, setTimeoutConst;
        $('.thumb').hover(function(){
            setTimeoutConst = setTimeout(function(){
                $(".thumb").hover(over, out);
                function over(){
                    TweenMax.to($(this).find(".title_thumb"), 0.3, {display:"block" , opacity:"1" , marginTop:"20px" , ease:Power2.easeOut , delay:"0.2"})
                    TweenMax.to($(this).find(".view_thumb"), 0.3, {display:"block" , opacity:"1" , ease:Power2.easeOut , delay:"0.5"});
                    TweenMax.to($(this).find(".layer_thumb"), 0.02, {opacity:"1" , ease:Power2.easeOut});
                }
                function out(){
                    TweenMax.to($(this).find(".title_thumb"), 0.3, {display:"none" , opacity:"0" , marginTop:"0px" , ease:Power2.easeOut})
                    TweenMax.to($(this).find(".view_thumb"), 0.2, {display:"none" , opacity:"0" , marginTop:"0px" , ease:Power2.easeOut})
                    TweenMax.to($(this).find(".layer_thumb"), 0.02, {opacity:"0" , ease:Power2.easeOut});
                }
            }, delay);
        },function(){
            clearTimeout(setTimeoutConst );
        })
    })


    If you have any idea I would be really glad.

    Thanks !

    See the Pen eeYGrO by leodurand (@leodurand) on CodePen

  2. I've just found an easy solution ! I simply used pointer-events to disable the links for a period of time.

    I add a pointer-events:none and change to "all" after the time of my animation. Also for the cursor for a "better" ux. 
     

            var OneAnimOnly = $(".link-menu" ).not(document.getElementById("prototypo"));
            TweenMax.to(OneAnimOnly, 0, {pointerEvents:"none" , cursor :"default"});
            TweenMax.to(OneAnimOnly, 0, {pointerEvents:"all" , cursor :"pointer" , delay:"1"});

     
    Thanks guys for the help !

    • Like 2
    • Thanks 1
  3. Hi guys, I screen recorded my project to illustrate my issue. 

     

    (1.Hover between links ) At the beginning, I wait the animation to complete before hovering another link, then I go quickly on links.
    http://leodurand.fr/digital/screen-record2.mp4

    (2. Click on link) First in the video, you'll see the animation doing fine. The seconde time (page refreshed) is what can happen if the user hover another link after clicking.

    http://leodurand.fr/digital/screen-video.mp4

    Thank you for taking the time, hoping to be more understandable this time . ^^

  4. Hi !
    I'm starting with TweenMax and got stucked with an issue. I have a menu which each links can start an animation but they can overlap and make the tween bug. I'd like each function to complete before being able to start another one. I've found that I should use onComplete but I don't get what I am suppose to do then.


    I've made a JSFiddle to demonstrate the issue I have.  On .mouseover, the tween start but if I hover too fast on an other link, it bugs. :/

    See the Pen dzNNwy by leodurand (@leodurand) on CodePen

×
×
  • Create New...