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

  • Home
  • SEARCH
  • 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 6366311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:24:18+00:00 2026-05-25T00:24:18+00:00

jQuery lets you do things like $div.bind(‘click.namespace’, function) $div.unbind(‘click.namespace’) Is there any equivalent in

  • 0

jQuery lets you do things like

$div.bind('click.namespace', function)
$div.unbind('click.namespace')

Is there any equivalent in MooTools? I tried defining a pseudo event:

Event.definePseudo('shim', function(split, fn, args) {fn.apply(this, args);})

document.body.addEvent('click', function(){alert('regular click');});
document.body.addEvent('click:shim', function(){alert('shim click');});

document.body.removeEvents('click') // removes both!
document.body.removeEvents('click:shim') // removes neither!

That seems like a dead end.

  • 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-25T00:24:18+00:00Added an answer on May 25, 2026 at 12:24 am

    I implemented it using Element.implement, but my question is asking for a native MooTools way to do it, without defining my own functions.

    Element.implement({
        // Call as element.bind('event.namespace', function() {});
        bind: function(name, funktion) {
            // Get event type and namespace
            var split = name.split('.'),
                eventName = split[0],
                namespace = split[1];
    
            // Store the event by its full name including namespace
            this.bindCache = this.bindCache || {};
    
            if(this.bindCache[name]) {
                this.bindCache[name].push(funktion);
            } else {
                this.bindCache[name] = [funktion];
            }
    
            // Bind the function to the event
            this.addEvent(eventName, funktion);
        },
    
        // Call as element.unbind('event.namespace');
        unbind: function(name) {
            // Unbind the specified event
            var eventName = name.split('.')[0],
                funktions = this.bindCache[name],
                x = 0,
                funktion;
    
            for(; funktion = funktions[x++]; ) {
                this.removeEvent(eventName, funktion);
            }
        }
    });
    
    document.body.bind('click.1', function() {alert('click 1');});
    document.body.bind('click.1', function() {alert('click 1 other');});
    document.body.bind('click.2', function() {alert('click 2');});
    
    document.body.unbind('click.1'); // leaves click.2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Jquery has a great language construct that looks like this: $(document).ready(function() { $(a).click(function() {
Is there a way to animate in Jquery without specifying every property? Lets, say:
There's a jQuery plugin out there that puts a dragable bar that lets you
I need to change the images on every click using jQuery, lets say while
lets say i use jquery.get to retrive a website to string and how am
Here is the problem: Lets say a Jquery toggle button which loads a Google
Lets say we want a library of javascript-based pieces of functionality (I'm thinking jquery):
I am currently working on a project that lets users post comments with jquery
I'm learning jQuery and I'd like to use it to solve an old problem
I'd like to make a textarea resizable. I tried out jQuery UI's resizable functionality,

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.