1212jtraceur
10-29-2006, 08:08 AM
I'm working on a JS/DOM based music player webpage. One of the major steps I have taken with this dynamically generating the HTML from the contents of the data array. This has caused a couple of problems...
The first, listed in the title occurs upon body.onload. body.onload calls initialize(), which then calls showInfo('dflt'), which calls setStyleOfChildren('infoContainer', 'display', 'none'). I think that tells me div#infoContainer has no children, which should be false because generatePlayerDivs(), generateImagesDiv(), generateInfoDivs(); are all called before showInfo('dflt').
Also, my images aren't being assigned their correct classes, and therefore, margins, through CSS. They are supposed to be in a table like layout with 20 px of space between them. I handle this by giving all images a 10px margin, then altering specific margin sizes based on 'class membership', which is assigned to images not completely surrounded by other images. getImageClass(x, y) works correctly, as far as I can tell, so this problem is in generateImagesDiv() (most likely the loop...).
Could you guys have a look at this and enlighten me? This is my first time coding DOM and I'm fairly new to JS.
Thanks,
1212jtraceur
The first, listed in the title occurs upon body.onload. body.onload calls initialize(), which then calls showInfo('dflt'), which calls setStyleOfChildren('infoContainer', 'display', 'none'). I think that tells me div#infoContainer has no children, which should be false because generatePlayerDivs(), generateImagesDiv(), generateInfoDivs(); are all called before showInfo('dflt').
Also, my images aren't being assigned their correct classes, and therefore, margins, through CSS. They are supposed to be in a table like layout with 20 px of space between them. I handle this by giving all images a 10px margin, then altering specific margin sizes based on 'class membership', which is assigned to images not completely surrounded by other images. getImageClass(x, y) works correctly, as far as I can tell, so this problem is in generateImagesDiv() (most likely the loop...).
Could you guys have a look at this and enlighten me? This is my first time coding DOM and I'm fairly new to JS.
Thanks,
1212jtraceur