Grow your CSS skills. Land your dream job.

Possible JavaScript Question?

  • # May 2, 2013 at 4:38 pm

    Is there a way in JavaScript to have it change the page if the user hasn’t moved there mouse in 2 minutes?

    # May 2, 2013 at 4:58 pm

    Sure. But it seems like a really bad idea. Can you give us a little more context?

    # May 2, 2013 at 5:23 pm

    http://postimg.org/image/kujxpt519/

    Here’s an image of a website i’m making the client wants it so when the user clicks on the boxes it would change content and it would also change if the user doesn’t move their mouse… I’m using the Kentico CMS… not my choice. Could you point me to an example site so maybe I can mimic/ use the jQuery or JavaScript? Thanks Guys!

    # May 2, 2013 at 5:26 pm

    Some pseudo code to help you along.

    1.) Create a counter that counts to 119 seconds.
    2.) Reset counter if mouse move event is fired.
    -- or --
    2.) Reset counter if x or y has changed.
    3.) Once counter reaches target time redirect page.

    If you are dealing with log in times, shopping carts, etc you may want to deal with your server side stuff (sessions etc). Always remember, i can disable JS :)

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".