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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:15:45+00:00 2026-05-23T13:15:45+00:00

I was building a slide-menu with javascript using classes and objects and a little

  • 0

I was building a slide-menu with javascript using classes and objects and a little bit of jquery as part of my efforts to learn javascript more deeply.
Everything went right until I wanted to bind a mouseleave to the initiator of my menu.
So here’s my code block

 var el;
 function generate(obj){
  return function(){obj.slidein();}
  } 
 function slider(arg1,arg2){
 ...//Some junk
 el=this;
 for(i=0;i<this.nsubs;i++){ ...
 $("#"+this.id+i).bind('mouseleave',function(){setTimeout("generate(el)",500)});
  }
 ...
 }

Well, I get no error on firefox error console but somehow the slidein() function which I want to be attached to the mouseleave is not being called when mouse leaves the element in question.

Can Someone explain what I am doing wrong here?

  • 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-05-23T13:15:46+00:00Added an answer on May 23, 2026 at 1:15 pm

    Alright, I sorted it out on my own, what I actually needed was a closure that returns a function with ‘setTimeout(generate(ObjPassedToClosure))’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hey all, another interesting one, I'm building a menu that will slide across the
I'm building a simple slideshow using jQuery. I have the basics down, but as
I am building an ASP.NET MVC web application and I'm using jQuery for some
I am building a site that uses two jquery plugins: A Jquery Menu (that
I am starting a little side project which consists of building a small-medium sized,
building a site using PHP and MySQL that needs to store a lot of
I'm building a menu control that consists of a header area and a content
I am building my very first Flash Slide Presentation. However, I would like to
I'm building a calculator that has a slider. Everytime I slide the bar an
I am currently building a presentation using LaTeX beamer. Is there a way to

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.