treehouse : what would you like to learn today?
Web Design Web Development iOS Development

help with background overlay

  • Im Working on this Page: http://gpt.hernan.org/gpnew/v1%20(Referrals%20hover).html When hovering on Referrals Button, a Background Overlay appears, I need it to gradually appear.

    Maybe some Fade in or out animation.

    I'm using this script to make the Overlay run.

      (function(){
         $('#coins').on('mouseenter', function(){
                var w = $(window).width();
                var h = $(window).height();
            $('').appendTo('body').addClass('overlay').css({ 'width': w, 'height': h });
            }).on('mouseleave', function(){
            $('.overlay').remove();
            })                
      })();
    
  • Link is dead (it worked earlier though), anyway you can use jQuery's fadeIn and fadeOut functions, you can probably add them somewhere in your chain of functions.