Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7760895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T14:00:45+00:00 2026-06-01T14:00:45+00:00

I found a script and want to mod it a bit. Im trying to

  • 0

I found a script and want to mod it a bit. Im trying to animate a div #menuwrap when the user is inactive or active over an certain div #gallery.

Now it still animates even outside the #gallery after its animated the first time.

Any help is much appreciated!

Demo: http://jsfiddle.net/m2FvY/1/

   $('#gallery').mouseover(function() {
        var interval = 1;
       setInterval(function(){            
           if(interval == 5){
               $('#menuwrap').animate({top: '-50px'}, 100); 
               interval = 1;
           }
           interval = interval+1;
            console.log(interval);
        },200); 

        $('#gallery').bind('mousemove keypress', function() {
            $('#menuwrap').animate({top: '0'}, 100); 
            interval = 1;
        }); 
});
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T14:00:47+00:00Added an answer on June 1, 2026 at 2:00 pm

    JSFIDDLE DEMO

    Delay timer resets anytime the user triggers the mousemove or keypress event on #gallery. You could also add the hover event in there to ensure the menu never hides when hovered over #gallery.

        var interval = 1;
    
        function delayCheck()
        {
           if(interval == 5)
           {
               $('#menuwrap').animate({top: '-50px'}, 100);
               interval = 1;
           }
           interval = interval+1; console.log(interval);
        }
    
        $('#gallery').bind('mousemove keypress', function() {
            $('#menuwrap').animate({top: '0'}, 100);
            interval = 1;
    
            // reset the delay timer
            clearInterval(_delay); console.log('reset timer');
            _delay = setInterval(delayCheck, 500);
        });
    
    
        // starts delay timer when page loads
        _delay = setInterval(delayCheck, 500);
    

    ANSWER PART 2

    JSFIDDLE DEMO #2

    Only checks for inactivity once #gallery events mousemove or keypress have been triggered. Once the user has moved out of the #gallery box, it will kill the delayCheck() and set the #menuwrap back to top: -50px.

        var interval = 1;
        _delay = 0;
    
        function delayCheck()
        {
           if(interval == 5)
           {
               $('#menuwrap').animate({top: '-50px'}, 100);
               interval = 1;
               clearInterval(_delay);
           }
           interval = interval+1;
           console.log(interval);
        }
    
        // turn delayCheck() ON, when mousing to #gallery
        $('#gallery').bind('mousemove keypress', function()
        {
            console.log("mousemove keypress");
    
            $('#menuwrap').animate({top: '0'}, 100);
            interval = 1;
    
            // reset delayCheck
            clearInterval(_delay);
            _delay = setInterval(delayCheck, 500);
        });
    
        // turn delayCheck() OFF, when mousing out of #gallery
        $('#gallery').mouseout(function(){
            console.log("mouseout");
            $('#menuwrap').animate({top: '-50px'}, 100);
            interval = 1;
    
            clearInterval(_delay);
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create super script for desired text selected by user. I found
I want to run a shell script on startup by google ,I found that
I have found this script that expand image when mouse is over, but when
I found this script (http://coolersport.info/) and downloaded it. I want change some things in
I want to convert a multi-dimensional PHP array to JavaScript and found this script
I found this script from a tutorial but I don't want the validation part,
I have a jQuery tabs script found here . What I am trying to
I found this script: <script language=Javascript TYPE=text/javascript> var container = document.getElementById('dl'); var seconds =
I found a script which has the following snippet:- userid=`expr \`id\` : .*uid=[0-9]*(\(.[0-9a-z]*\)) .*`
I found a script on here that will export each worksheet in a file

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.