[jQuery] An important parent bug

[jQuery] An important parent bug


Hello!
I'm trying to do a window plugin with jQuery, but I have a serious
problem. My code is based on the UI jQuery Dialog, but I need to
imlement the windows with canvas and a lot of functions.
I call my function: $j('<iframe src="http://
www.google.es/').ventana(), for example.
(function($j){
$j.fn.ventana = function(opciones){
var o = $j.extend({}, $j.fn.ventana.defaults, opciones);
return this.each(function(){
if (!($j(this).parent(".ventana").length ||
$j(el).is(".ventana"))){
$j.fn.ventana.crearEstructura(this,o);
}
$j.fn.ventana.abrirVentana(this);
});
};
$j.fn.ventana.crearEstructura = function(contenido,o){
if ($j(contenido).parent().length){
contenido = $j(contenido).html();
contenido.remove();
}else{
contenido = $j(contenido).wrap('<div class="auxiliar"></
div>').html();
}
And all go well. BUT! When I call my function $j('<div class="prueba"/