[jQuery] Page will not display rendered html after DOMmanipulationin IE
Here's another take on the buildGallery function, using a Lisp flavor. I
didn't test it but the syntax is okay. I've assumed that it's not necessary
to hide the empty TDs, it just skips putting IMG in those cells.
Another way to approach it would be to build a template row in DOM objects,
then cloneNode the row and change the IMG SRC attributes.
var buildGallery = function(nColumns,nArray)
{
function genArray(n,f)
{
var a = [];
for ( var i=0; i < n; i++ )
ret[i] = f(i);
return a;
}
var nimg = 0;
$('div.picGallery').append(
$.TABLE({'class': 'picContainer'}, $.THEAD({},
genArray(nArray.length/nColumns, function(r){
return $.TR({'class' : 'picRow'},
genArray(nColumns, function(c){
return $.TD({'class': 'picColumn'},
++nimg <= nArray.length? $.IMG({'class': 'small',
src: imgPath+'/'+nArray[nimg-1]}) : ''
);
})
);
})
))
);
}
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of Michael Geary
Sent: Thursday, May 04, 2006 11:58 AM
To: 'jQuery Discussion.'
Subject: Re: [jQuery] Page will not display rendered html after
DOMmanipulationin IE