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 9133243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:27:07+00:00 2026-06-17T08:27:07+00:00

I want my div to slide up back to the start position when my

  • 0

I want my div to slide up back to the start position when my mouse goes out, but I want my div to cancel that action and go back to its expanded position if the mouse goes back over the div again.

I need some way to stop this action:

    $(".logo").mouseleave(function(){
            $(".logo").animate({top: '-65px'}, 'slow')
    });

Here is the fiddle: http://jsfiddle.net/gaPah/6/

  • 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-17T08:27:08+00:00Added an answer on June 17, 2026 at 8:27 am

    Ok finally got to the bottom of this. User clicks toggled. Div opens. User leaves div. It waits 700ms then closes. If the user interrupts it closing it reopens. If the user doesn’t interrupt, it resets.

    NB. .delay() does not play well with .animate() so it gets complicated, but I’m sure there would be an easier way to do this.

    Also note, I’ve bound custom event openme to avoid writing the same animate line twice (once on mouseover and once on click of the button).

    Working demo

    $('#btn_panel').click(function(event){
      $(".logo").trigger('openme');
    });
    
    $('.logo').on('openme', function(){
      $(this).stop().animate({top: 0}, 700);
    }).on('mouseenter', function(){
      clearTimeout($(this).to);
      if (parseInt($(this).css('top'))>-65){
          $(this).trigger('openme');
      }
    }).on('mouseleave', function(){
      var el=$(this);
      $(this).to=setTimeout(function(){
        el.animate({top: -65}, 700);
      },700);
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Ive got a div that i want to slide out on click using .show(slide,
I have implemented a slide out div on my site that sits on the
I want a div to be always at the right of its parent div,
I just want that horizontal div (about 50 pixels tall) that span across the
I want to have the div #topmessage slide down on the users second visit
I want to create a jquery script that works like the iphones slide to
I want to slide in a div from left and move the current to
I want the bottom div to slide up down on hover at the bottom
I'm trying to create a slide out div function. Basically, it's a rectangle shaped
I have the below code that is animating a div (#feedback-form-container) to slide in

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.