デフォルトイベントとバブリングの抑制(旧IE対応)。
var cancelBubble,
cancelEvent;
cancelBubble = (function () {
var func = function () {};
if (typeof Event !== 'undefined' && typeof Event.prototype.stopPropagation === 'function') {
func = function (e) { e.stopPropagation(); };
} else if (window.event) {
func = function () { window.event.cancelBubble = true; };
}
return func;
}());
cancelEvent = (function () {
var func = function () {};
if (typeof Event !== 'undefined' && typeof Event.prototype.preventDefault === 'function') {
func = function (e) { e.preventDefault(); };
} else if (window.event) {
func = function () { window.event.returnValue = false; };
}
return func;
}());