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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:58:50+00:00 2026-06-18T23:58:50+00:00

mouse over after two seconds ,but set time out function is not working js

  • 0

mouse over after two seconds ,but set time out function is not working

js

setTimeout(function () {
  $('.box').mouseover(function () {
    $(this).animate({
      marginTop: '-224px',
      height: '300px'
    })
    $(this).find('.rotate-arrow').addClass('rotate');
  });
}, 2000);
  • 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-18T23:58:51+00:00Added an answer on June 18, 2026 at 11:58 pm

    Explanation:

    You have attached the event handler to inside of the setTimeout which essentially means that this will wait 2 seconds before attaching the function to a mouseover of the .box element.

    Unfortunately $(this) from the setTimeout function is out of scope so your values were not being read. Luckily you can simply assign $(this) to a variable that is within the scope of the nested function with which you will be able to access the jquery object as you normally would.


    Solution:

    $('.box').mouseover(function () {
      var $this = $(this)
      setTimeout(function () {
        $this.animate({ marginTop: '-224px', height: '300px' })
        $this.find('.rotate-arrow').addClass('rotate');
      }, 2000);
    });
    

    jsFiddle:

    • http://jsfiddle.net/mF46t/
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When mouse is over the image, span content slides down after two seconds, also
I have a following code $(document).ready(function(){ //When mouse rolls over $(#nav #nav_li).mouseover(function(){ $(this).stop().animate({height:'140px', width:'182px'},{queue:false,
I have table with few rows, after use hover mouse over row I want
I need to flash images while mouse is over them and stop flashing after
Is there a way to trigger a mouseover event only after the mouse was
Hovering the mouse over an element flips it. I would like a JavaScript function
i have list of images and on mouse over there is option box shows
Example: http://wispinternet.com/glencoe/ When the page is first loaded, the first time you mouse over
Helo! Dropdown in IE7 displayed not correct. When I put mouse over it's appears
When you move your mouse over a link with title, after a while it

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.