Comunidad de diseño web y desarrollo en internet online

jquery que me falta en este if, no evalua

Citar            
MensajeEscrito el 18 Oct 2011 06:50 pm
hola gente3 me vuelvo loco con esto

Código :

      newslidecontentDiv.each(function(i){
         var el = $(this).find(".last_div");
         if(el !== undefined){
            // tiene .last_div
            var valorW = 0;
            $(".last_div").siblings('div:not(.clearfix)').each(
               function(i){
                  valorW += parseInt($(this).css("width"));
               }
            );
            alert( "Hay last_div  " + i + "/" + newslidecontentDiv.length + " > " + el.attr('class') + " W:" + valorW );
         } else {
            valorW = 0;
         }



El if al parecer si lo lee, manda undefined cuando no encuentra la clase .last_div, pero no respeta el if/else

if(el !== undefined){

Por comicSans

Claber

151 de clabLevel



 

firefox
Citar            
MensajeEscrito el 18 Oct 2011 06:53 pm
incluso si lo pongo 'undefined', nada ;(

Por comicSans

Claber

151 de clabLevel



 

firefox
Citar            
MensajeEscrito el 18 Oct 2011 06:56 pm
que burro!

if( el.attr('class') ){ ...

jiji



Learning JQuery !

Por comicSans

Claber

151 de clabLevel



 

firefox

 

Cristalab BabyBlue v4 + V4 © 2011 Cristalab
Powered by ClabEngines v4, HTML5, love and ponies.