I'm working in a jQuery plugin and tried to trigger a custom event after insert a jQuery Dom Element in body.. but the events never occurs..
Is this possible without user interact?
My code is:
var $div = $( '<div />' ), $container = $div.clone();
$container.text( 'test' ).appendTo( 'body' );
$.event.trigger( 'ContainerInit', [ $container ]);
$( document ).on( 'ContainerInit', function( e, $elementContainer ) {
alert( 'test here!' );
});