// For whatever reason, IE has trouble passing the window object
// around, causing it to be cloned in the process
- if ( elem.setInterval && elem != window )
+ if ( elem.setInterval && ( elem != window && !elem.frameElement ) )
elem = window;
// Make sure that the function being executed has a unique ID
// Namespaced event handlers
var namespaces = type.split(".");
type = namespaces.shift();
- var namespace = new RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
+ var all = !namespaces.length,
+ namespace = new RegExp("(^|\\.)" + namespaces.slice().sort().join(".*\\.") + "(\\.|$)");
if ( events[type] ) {
// remove the given handler for the given type
else
for ( var handle in events[type] )
// Handle the removal of namespaced events
- if ( namespace.test(events[type][handle].type) )
+ if ( all || namespace.test(events[type][handle].type) )
delete events[type][handle];
if ( jQuery.event.specialAll[type] )