Skip to content

Instantly share code, notes, and snippets.

@orangexception
Created January 8, 2014 19:51
Show Gist options
  • Save orangexception/8323391 to your computer and use it in GitHub Desktop.
Save orangexception/8323391 to your computer and use it in GitHub Desktop.
Bootstrap `button a` click issue in FireFox.
// FireFox?
if( $.browser.mozilla ) {
// Button Pressed?
$( "button" ).click( function() {
// Delegate Click & Click It
$( this )
// Delegate Click
.delegate( "a" , "click" , function ( event ) {
// Find Anchor
var anchor= $( this );
// Get Events
var events= anchor.data( 'events' );
// Click Event Already Bound?
if( events
&& typeof( events ) == 'object'
&& typeof( events[ 'click' ] ) == 'object' ) {
// Click It
anchor.click();
}
// Try the HREF
document.location= anchor.attr( "href" );
})
.children( "a" ).click();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment