471,319 Members | 1,947 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Swapping/splitting content of two divisions

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.
Jul 23 '05 #1
1 1445
"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

Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Sandman | last post: by
3 posts views Thread by Christopher Jeris | last post: by
2 posts views Thread by Dennis M. Marks | last post: by
9 posts views Thread by Stanimir Stamenkov | last post: by
4 posts views Thread by guitarromantic | last post: by
6 posts views Thread by nwheavyw8 | last post: by
34 posts views Thread by john | last post: by
1 post views Thread by chris f | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.