SO I'm building my portfolio page, I figure it's about time as I've finally found my groove in design style. I've designed the webpage and built the html, but having some trouble on the ajax part. I'm sure this could be easier with a server-side language, but I figure it's a good time to learn ajax. Here's the relevant portion of my html:
<div id="leftcolumn">
<div id="webcontainer">
<h1>Web Design</h1>
<div id="webthumbcontainer">
</div>
</div>
<div id="logocontainer">
<h1>Business Identity</h1>
<div id="logothumbcontainer">
</div>
</div>
<div id="adcontainer">
<h1>Advertisement Design</h1>
<div id="adthumbcontainer">
</div>
</div>
<div id="personalcontainer">
<h1>Personal Art</h1>
<div id="personalthumbcontainer">
</div>
</div>
</div>
<div id="centercolumn">
<div id="imgcontainer">
</div>
</div>
<div id="rightcolumn">
<div id="textcontainer">
<p>Description area
</p>
</div>
</div>
- <div id="leftcolumn">
-
- <div id="webcontainer">
- <h1>Web Design</h1>
- <div id="webthumbcontainer">
- </div>
- </div>
-
- <div id="logocontainer">
- <h1>Business Identity</h1>
- <div id="logothumbcontainer">
- </div>
- </div>
-
- <div id="adcontainer">
- <h1>Advertisement Design</h1>
- <div id="adthumbcontainer">
- </div>
- </div>
-
- <div id="personalcontainer">
- <h1>Personal Art</h1>
- <div id="personalthumbcontainer">
- </div>
- </div>
- </div>
-
- <div id="centercolumn">
-
- <div id="imgcontainer">
- </div>
- </div>
-
- <div id="rightcolumn">
-
- <div id="textcontainer">
- <p>Description area
- </p>
- </div>
- </div>
-
As you can see, I want to split my work up into separate categories: web design, advertisement design, business identity, and personal art. I want a list of blocks to be generated in each category with the appropriate number of links corresponding to the number of art work. Here's my xml file, abridged:
<?xml version="1.0" encoding="UTF-8"?>
<images>
<image>
<category>web</category>
<link>link/to/webimage.jpg</link>
<description>description text</description>
</image>
<image>
<category>ad</category>
<link>link/to/advertisementimage.jpg</link>
<description>description text</description>
</image>
<image>
<category>bus</category>
<link>link/to/identityimage.jpg</link>
<description>description text</description>
</image>
<image>
<category>personal</category>
<link>link/to/personalimage.jpg</link>
<description>description text</description>
</image>
</images>
- <?xml version="1.0" encoding="UTF-8"?>
-
- <images>
- <image>
- <category>web</category>
- <link>link/to/webimage.jpg</link>
- <description>description text</description>
- </image>
- <image>
- <category>ad</category>
- <link>link/to/advertisementimage.jpg</link>
- <description>description text</description>
- </image>
- <image>
- <category>bus</category>
- <link>link/to/identityimage.jpg</link>
- <description>description text</description>
- </image>
- <image>
- <category>personal</category>
- <link>link/to/personalimage.jpg</link>
- <description>description text</description>
- </image>
- </images>
-
Where I'm having trouble:
- I want dummy links to be generated in each category with the correct number of images defined in that category by my xml. In this case, it would be one dummy link per category. These links would be set in a generated <ul> under each <h1> tag in my html.
- When the user clicks on the dummy link, the corresponding image from the xml will be loaded into the "imgcontainer" div tag.
- At the same time, the description would be loaded as a paragraph in the "textcontainer" div.
The whole idea is that when I want to add new work, I simply add the image to the folder and edit the xml file.
Any ideas?
Use your words like arrows to shoot toward your goal.