Page 1 of 1

Javascipt Image gallery :)

PostPosted: Fri Sep 25, 2009 2:20 am
by pizzadox
http://vvedesign.com/test/#
http://www.vvedesign.com/test/img.xml xml file

My javascript, xml image gallery is near completion. Had some troubles getting it to run smoothly on IE but I got that fixed now (i think). :lol: The code is kinda messy, going to clean it when I'm done.
Any suggestions?

Re: Javascipt Image gallery :)

PostPosted: Fri Sep 25, 2009 8:18 am
by zombie@computer
It seems to work okay i guess. Looks clean, though layout isn't perfect imho.

suggestions:
1) You rely on javascript completely. Disable javascript and your galery is gone
2) You rely on httpxmlrequests. Esp in this case. Anyone capable of editing the xml file is also capable of editing the actual galery page's html, so that is no argument to use an xml next to the html galery. Serious users use php/mysql anyway, rendering it obsolete in its entirety.
3) innerHTML. Its considered bad practice. Use Document.createElement() instead to create your elements.
4) image size. Doesnt need to be in the xml:
Code: Select all
Image img = new Image();
img.src = myUrl
size = img.height || img.width

if you are just going to use the ratios this is all you need.

Well, you wanted suggestions, here ya go :)

Re: Javascipt Image gallery :)

PostPosted: Fri Sep 25, 2009 7:45 pm
by abathor
The best thing to do is get a working gallery with HTML and CSS alone, and then add javascript to enhance it. This way, you will have a great little page that doesn't rely on javascript and XHTML requests.

Re: Javascipt Image gallery :)

PostPosted: Fri Sep 25, 2009 8:13 pm
by RC-1290
Although I strongly agree with the above two posts, I feel I should say I like it anyway :)