Swapping/splitting content of two divisions

R

Richard

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.
 
G

Grant Wagner

Richard said:
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());
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top