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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T19:37:46+00:00 2026-06-18T19:37:46+00:00

app.myView = Backbone.View.extend({ events: { ‘mouseenter .myitem’: ‘myfunction’ } }); how do i delay

  • 0
app.myView = Backbone.View.extend({
   events: {
   'mouseenter .myitem': 'myfunction'
   }    
});

how do i delay this event from being created until a certain time or until I decide that i’d like to create it. right now it is created as soon as my view is loading in and the mouseevent is triggering as soon as I enter .myitem

  • 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-18T19:37:48+00:00Added an answer on June 18, 2026 at 7:37 pm

    Backbone binds view events using delegateEvents:

    delegateEvents delegateEvents([events])

    Uses jQuery’s on function to provide declarative callbacks for DOM events within a view. If an events hash is not passed directly, uses this.events as the source.
    […]
    When delegateEvents is run again, perhaps with a different events hash, all callbacks are removed and delegated afresh — useful for views which need to behave differently when in different modes.

    You can call delegateEvents whenever you want to change the event bindings. So one way to do this would be to adjust this.events and call this.delegateEvents():

    add_event: function() {
        this.events = _({}).extend(this.events, {
            'mouseenter .myitem': 'myfunction'
        });
        this.delegateEvents();
    }
    

    The extend call is a good idea because Backbone.View.extend will leave the events attached the view’s prototype so simply changing this.events:

    this.events['mouseenter .myitem'] = 'myfunction';
    

    would alter the events for all instances of the view. The advantage of this is that calling undelegateEvents will do the Right Thing and all your view events will be handled the same way.

    Demo: http://jsfiddle.net/ambiguous/Bd4SB/

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

Sidebar

Related Questions

Here is my Backbone: App.Models.Count = Backbone.Model.extend({ url: this.url, initialize: function() { this.fetch({ success:
I'm having trouble with this in a backbone.js project. This is my view: app.SomeView
I am seeing some weird behaviour in my Backbone view. When i console.log this.model
I've got this backbone code and I cannot figure out why the events in
I'm new to Backbone.Marionette and now I'm developing my first app with this framework.
Currently, if we define our view as {{#view App.myView}} , ember/handlebars will wrap the
I have Backbone App Here are codes : This is Main.coffee : require [App/app,backbone]
I'm facing a change event not firing issue on Backbone.js =/ Here my view
I'm facing an issue with my backbone.js app: I'm trying to fetch data from
/app.js var Welcome = Ember.Application.create({}); Welcome.person = Ember.View.extend({ personName: 'Andrew' }); Here is the

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.