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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:08:48+00:00 2026-05-27T02:08:48+00:00

So I am just trying to add some functions to hover. the below does

  • 0

So I am just trying to add some functions to hover. the below does about the same thing except the one with the for loop i have the target stored in an array. I actually have a few questions.

  1. is this the correct use of stopPropagation?
  2. what’s the best practice for doing something like this?
  3. which one of the below method is faster and uses less resources?
  4. I know I can use hover() but I used bind because I thought it is faster, is my thinking correct?

thank you

    for (var i in slides) {
        $(slides[i].el).bind( {
            mouseenter: function (event) {
                event.stopPropagation();
                // do something
            },
            mouseleave: function (event) {
                event.stopPropagation();
                //do something
            }
        });
    }

    $("#vehicleSlides .vehicleAreas").bind( {
        mouseenter: function (event) {
            event.stopPropagation();
            // do something
        },
        mouseleave: function (event) {
            event.stopPropagation();
            //do something
        }
    });
  • 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-27T02:08:48+00:00Added an answer on May 27, 2026 at 2:08 am

    1 – is this the correct use of stopPropagation

    If you wish to stop the event bubbling up the DOM tree, then yes.

    2 – what’s the best practice for doing something like this

    Personally, I prefer the jQuery selector followed by methods, but this is just a preference. The best practice is whatever style you and your team all agree upon and use consistently.

    3 – which one of the below method is faster and uses less resources

    In practical terms, there will be next to no difference between the two.

    4 – I know I can use hover() but I used bind because I thought it is faster, is my thinking correct

    The jQuery hover method is shorthand for the bind to mouseenter and mouseleave events, so there will be one extra function call using hover, however there will be almost no difference in performance.

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

Sidebar

Related Questions

Some sample, straight forward gtk2 within-main-loop I'm currently trying to add code at key-press-event
So I'm just trying to add some social networking share links (facebook, g+, addthis
I am trying to add/remove UILabels to a ScrollView. The adding takes place just
I'm trying to access some Ghostscript functions like so: [DllImport(@C:\Program Files\GPLGS\gsdll32.dll, EntryPoint = gsapi_revision)]
I'm trying to change the behaviour of some functions in C with help of
I need some consultation here. I am a C# developer, and for just about
Hello I want to create a dll with some functions. For starters I'm trying
Ok so i posted earlier about trying to (without any prebuilt functions) remove additional
I'm trying to add some AJAX to my forms, however I am extremely confused
I have this HTML file with some CSS styles, now I am trying 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.