"Richard" <An*******@127.001> wrote in message
news:cr*********@news1.newsguy.com...
http://dynamicdrive.com/dynamicindex5/linkinfo.htm
Using the above script, I have a plan whereby when the main link is
active, two different content swaps take place.
Column A shows the main menu which is working just fine.
In column b I have two subdivisions.
Top is for thumbnails, bottom is for description.
What I am looking at doing, if possible, is to have the thumbnails and
descriptions change at the same time.
Perhaps using a two dimensional array?
They use a single array:
var content=new Array()
Content[0]='text'
Could I not have say content[0][0]='text' and content[0][1]="images"?
So that when the link is activated, I can direct to the appropriate
division?
Any one have any thoughts on how I might best achieve this goal?
Any other similar scripts available to look at?
I prefer easy to edit types.
Use an array of objects, each object will have a column A value and a
column B value:
var content = [];
content[0] = { columnA:'image1.jpg', columnB:'image1 description' };
content[1] = { columnA:'image2.jpg', columnB:'image2 description' };
// ...
If you want to get really fancy, you could create a "Thumbnail" object
with methods to access the various information:
function Thumbnail(image, text) {
var columnA = image;
var columnB = text;
this.getColumnA = function() {
return columnA;
}
this.getColumnB = function() {
return columnB;
}
}
var content = [];
content[0] = new Thumbnail('image1.jpg', 'image1 description');
content[0] = new Thumbnail('image2.jpg', 'image2 description');
alert(content[0].getColumnA() + ';' + content[0].getColumnB());
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq