JSFiddle

  • Javascript custom events (jQuery)

    jQuery 1.8.3, HTML, CSS, JavaScript

    var Parent = function(name) {
        this.name = name;
        this.children = [];
    }
    Parent.prototype = {
        addChild: function(child) {
            var this_parent = this;
            this.children.push ...
  • Movement event handler

    Mootools 1.4.5, HTML, CSS, JavaScript

    var MovementHandler = function(startHandler, moveHandler, stopHandler, context, delay) {
        return function(evt) {
            var control = this;
            if (!control.started) {
                startHandler(evt, context ...
  • Click-triggered movement handler

    jQuery 1.7.2, HTML, CSS, JavaScript

    var ClickMovementHandler = function(startHandler, moveHandler, stopHandler, context) {
        return function(evt) {
            _this = this;
            startHandler.call(this, evt, context);
    
            var mover = function ...
  • Double Click Handler

    jQuery 1.7.2, HTML, CSS, JavaScript

    var DoubleClickHandler = function(onClick, onDoubleClick, context, delay) {
        return function(evt) {
            var control = this;
            control.clickCount = (control.clickCount || 0) + 1;
            if ...