Hide the toast after the duration is up.
Also remove the element from the DOM once the transition is complete.

@param {jQuery} element
5280
function(element) {
        element = $(element);

        // Pass the element since it gets removed
        this.fireEvent('hiding', [element]);

        element.transitionend(function() {
            element.remove();
            this.fireEvent('hidden');
        }.bind(this)).conceal();
    }
1289370
function (element, options) {
      var self = this;
      element[0].$mdGesture = element[0].$mdGesture || {};
      element[0].$mdGesture[this.name] = options || {};
      element.on('$destroy', onDestroy);

      self.onSetup(element, options || {});

      return onDestroy;

      function onDestroy() {
        delete element[0].$mdGesture[self.name];
        element.off('$destroy', onDestroy);

        self.onCleanup(element, options || {});
      }
    }
892415
function(element) {
    if (!(element && element.nodeType === 1)) {
      return;
    }
    var mouseHandlers = _mouseHandlers[element.zcClippingId];
    if (!(typeof mouseHandlers === "object" && mouseHandlers)) {
      return;
    }
    var key, val, mouseEvents = [ "move", "leave", "enter", "out", "over" ];
    for (var i = 0, len = mouseEvents.length; i < len; i++) {
      key = "mouse" + mouseEvents[i];
      val = mouseHandlers[key];
      if (typeof val === "function") {
        element.removeEventListener(key, val, false);
      }
    }
    delete _mouseHandlers[element.zcClippingId];
  }
1110449
function(element) {
                if (element === elt) {
                    var wrapper = svgCanvas.getElement();
                    wrapper.parentNode.removeChild(wrapper);
                }
            }
1113898
function disposeTimePicker(element) {
				element.parent().find('.clock-timepicker-autosize').remove();
				element.parent().find('.clock-timepicker-background').remove();
				element.parent().find('.clock-timepicker-popup').remove();
				element.unwrap();
				element.off('drag.clockTimePicker dragend.clockTimePicker dragover.clockTimePicker dragenter.clockTimePicker dragstart.clockTimePicker dragleave.clockTimePicker drop.clockTimePicker selectstart.clockTimePicker contextmenu.clockTimePicker');
				element.off('mousedown.clockTimePicker');
				element.off('keyup.clockTimePicker');
				element.off('keydown.clockTimePicker');
				element.off('mousewheel.clockTimePicker');
				element.off('focus.clockTimePicker');				
				if (element.attr('data-autocomplete-orig')) {
					element.attr('autocomplete', element.attr('data-autocomplete-orig'));
					element.removeAttr('data-autocomplete-orig');
				} else element.removeAttr('autocomplete');
				if (element.attr('data-autocorrect-orig')) {
					element.attr('autocorrect', element.attr('data-autocorrect-orig'));
					element.removeAttr('data-autocorrect-orig');
				} else element.removeAttr('autocorrect');
				if (element.attr('data-autocapitalize-orig')) {
					element.attr('autocapitalize', element.attr('data-autocapitalize-orig'));
					element.removeAttr('data-autocapitalize-orig');
				} else element.removeAttr('autocapitalize');
				if (element.attr('data-spellcheck-orig')) {
					element.attr('spellcheck', element.attr('data-spellcheck-orig'));
					element.removeAttr('data-spellcheck-orig');
				} else element.removeAttr('spellcheck');
			}
979229
function clickEffect(e){
  var d=document.createElement("div");
  d.className="clickEffect";
  d.style.top=e.clientY+"px";d.style.left=e.clientX+"px";
  document.body.appendChild(d);
  d.addEventListener('animationend',function(){d.parentElement.removeChild(d);}.bind(this));
}
1304707
function(options) {
    options = options || {};
    var self = this;

    if (options.transition && !options.duration) {
      throw new Error('"options.duration" is required when "options.transition" is enabled.');
    }

    var transitionName = util.transitionPropertyName;

    if (options.transition || (options.duration && options.duration > 0)) {
      var transitionValue = options.transition || ('all ' + options.duration + 's ' + (options.timing || 'linear'));

      this.transitionQueue.push(function(done) {
        var elements = this.elements;
        var timeoutId;

        var clearTransition = function() {
          elements.forEach(function(element) {
            element.style[transitionName] = '';
          });
        };

        // add "transitionend" event handler
        var removeListeners = util.onceOnTransitionEnd(elements[0], function() {
          clearTimeout(timeoutId);
          clearTransition();
          done();
        });

        // for fail safe.
        timeoutId = setTimeout(function() {
          removeListeners();
          clearTransition();
          done();
        }, options.duration * 1000 * TIMEOUT_RATIO);

        // transition and style settings
        elements.forEach(function(element, index) {

          var css = self.lastStyleAttributeDict[index];

          if (!css) {
            throw new Error('restoreStyle(): The style is not saved. Invoke saveStyle() before.');
          }

          self.lastStyleAttributeDict[index] = undefined;

          var name;
          for (var i = 0, len = element.style.length; i < len; i++) {
            name = element.style[i];
            if (css[name] === undefined) {
              css[name] = '';
            }
          }

          element.style[transitionName] = transitionValue;

          Object.keys(css).forEach(function(key) {
            if (key !== transitionName) {
              element.style[key] = css[key];
            }
          });

          element.style[transitionName] = transitionValue;
        });
      });
    } else {
      this.transitionQueue.push(function(done) {
        reset();
        done();
      });
    }

    return this;

    function reset() {
      // Clear transition animation settings.
      self.elements.forEach(function(element, index) {
        element.style[transitionName] = 'none';

        var css = self.lastStyleAttributeDict[index];

        if (!css) {
          throw new Error('restoreStyle(): The style is not saved. Invoke saveStyle() before.');
        }

        self.lastStyleAttributeDict[index] = undefined;

        for (var i = 0, name = ''; i < element.style.length; i++) {
          name = element.style[i];
          if (typeof css[element.style[i]] === 'undefined') {
            css[element.style[i]] = '';
          }
        }

        Object.keys(css).forEach(function(key) {
          element.style[key] = css[key];
        });

      });
    }
  }
695217
function cleanElement() {
        destroyListener();

        element
          .removeClass('md-active')
          .attr('aria-hidden', 'true')
          .css({
            'display': 'none',
            'top': '',
            'right': '',
            'bottom': '',
            'left': '',
            'font-size': '',
            'min-width': ''
          });
        element.parent().find('md-select-value').removeAttr('aria-hidden');

        announceClosed(opts);

        if (!opts.$destroy && opts.restoreFocus) {
          opts.target.focus();
        }
      }
1151014
function (element, options) {
		this.$element      = $(element)
		this.options       = $.extend({}, Drawer.DEFAULTS, options)
		this.$trigger      = $(this.options.trigger).filter('[href="#' + element.id + '"], [data-target="#' + element.id + '"]')
		this.transitioning = null

		if (this.options.parent) {
			this.$parent = this.getParent()
		} else {
			this.addAriaAndDrawerdClass(this.$element, this.$trigger)
		}

		if (this.options.toggle) this.toggle()
	}
1250469
function hide() {
    if (isVisible()) {
        var hideFinishCb = function () {
            WinJS.Utilities.addClass(splashElement, 'hidden');
            splashElement.style.opacity = 1;
            enableUserInteraction();
            exitFullScreen();
        }

        // Color reversion before fading is over looks better:
        revertTitleBarColor();

        // https://issues.apache.org/jira/browse/CB-11751
        // This can occur when we directly replace whole document.body f.e. in a router.
        // Note that you should disable the splashscreen in this case or update a container element instead.
        if (document.getElementById(splashElement.id) == null) {
            hideFinishCb();
            return;
        }

        if (fadeSplashScreen) {
            fadeOut(splashElement, fadeSplashScreenDuration, hideFinishCb);
        } else {
            hideFinishCb();
        }
    }
}
454317
function(element, options) {
        this.nodes = element = $(element); // Set to nodes so instances are unset during destroy()
        options = this.setOptions(options, element);

        // Create the toasts wrapper
        this.createWrapper()
            .addClass(options.position)
            .attr('role', 'log')
            .aria({
                relevant: 'additions',
                hidden: 'false'
            });

        this.initialize();
    }
321778
function onRemove(scope, element, opts) {
      opts.cleanupInteraction();
      opts.cleanupBackdrop();
      opts.cleanupResizing();
      opts.hideBackdrop();

      // Before the menu is closing remove the clickable class.
      element.removeClass('md-clickable');

      // For navigation $destroy events, do a quick, non-animated removal,
      // but for normal closes (from clicks, etc) animate the removal

      return (opts.$destroy === true) ? detachAndClean() : animateRemoval().then(detachAndClean);

      /**
       * For normal closes, animate the removal.
       * For forced closes (like $destroy events), skip the animations
       */
      function animateRemoval() {
        return $animateCss(element, {addClass: 'md-leave'}).start();
      }

      /**
       * Detach the element
       */
      function detachAndClean() {
        element.removeClass('md-active');
        detachElement(element, opts);
        opts.alreadyOpen = false;
      }

    }
1289420
function( startMenu ) {
		if ( !startMenu ) {
			startMenu = this.active ? this.active.parent() : this.element;
		}

		startMenu
			.find( ".ui-menu" )
				.hide()
				.attr( "aria-hidden", "true" )
				.attr( "aria-expanded", "false" )
			.end()
			.find( "a.ui-state-active" )
				.removeClass( "ui-state-active" );
	}
344406
public static void removeDisablingOverlay(Element element) {

        List<Element> overlays = CmsDomUtil.getElementsByClass(
            I_CmsLayoutBundle.INSTANCE.generalCss().disablingOverlay(),
            Tag.div,
            element);
        if (overlays == null) {
            return;
        }
        for (Element overlay : overlays) {
            overlay.getParentElement().getStyle().clearPosition();
            overlay.removeFromParent();
        }
        element.removeClassName(I_CmsLayoutBundle.INSTANCE.generalCss().hideOverlay());
    }
1107699
function onEnd() {
          element.off(css3AnimationEvents, onAnimationProgress);
          $$jqLite.removeClass(element, activeClassName);
          $$jqLite.removeClass(element, pendingClassName);
          if (staggerTimeout) {
            $timeout.cancel(staggerTimeout);
          }
          animateClose(element, className);
          var node = extractElementNode(element);
          for (var i in appliedStyles) {
            node.style.removeProperty(appliedStyles[i]);
          }
        }
978473
function Menu(element) {
        this.element = element;
        _trigger(this.element, "showgoto", 1, true);
        window.setTimeout(window.remoteShowGoto);
        this.remove = this.remove.bind(this);
    }
282942
function removeEvent( token ) {
		if ( token.element.removeEventListener ) {
			token.element.removeEventListener( token.event, token.handler );
		} else {
			token.element.detachEvent( 'on' + token.event, token.handler );
		}
	}