Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  • Thread Tools
  • Rate This Thread
  1. #1
    New Coder LS5000's Avatar
    Join Date
    Dec 2014
    Location
    Kaunas, Lithuania
    Posts
    58
    Thanks
    5
    Thanked 0 Times in 0 Posts

    Events on entering or leaving screen

    For example in Facebook, when the player goes out of screen, video stops. Or like in here: Daisoras when you scroll down a bit, some animations start. It doesn't look like a window.pageYOffset thing, because if I zoom out the screen to where I can view these elements when page loads, the animations do the same without any scrolling.

    Any advice or a link on to how to do that?

  2. #2
    New Coder LS5000's Avatar
    Join Date
    Dec 2014
    Location
    Kaunas, Lithuania
    Posts
    58
    Thanks
    5
    Thanked 0 Times in 0 Posts
    wow. anybody, anytime now?

  3. #3
    New to the CF scene
    Join Date
    Mar 2016
    Posts
    9
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i think there is no one who can answer this question. Well LS500 i am quite new in this field and i really don't know about this otherwise i will answer your question.
    Good Luck !

  4. #4
    New Coder
    Join Date
    Feb 2016
    Posts
    80
    Thanks
    0
    Thanked 16 Times in 16 Posts
    This code does it:
    Code:
                $(window).on("mouseenter", function () { alert("enter") });
                $(window).on("mouseleave", function () { alert("leave") });
    It uses jQuery, don't forget to include it.


 

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •