/    Sign up×
Community /Pin to ProfileBookmark

More the one image-galleries in one page (simple I guess ..)

(sorry for the spelling mistakes in the subject (me french..) I published it before checking the spelling.. and now I can’t correct it anymore. It had to be: More than one image-gallery in one page..)

There is a small image-gallery in a website working fine.
But I would like several of them in the same page.
Here is the problem [url]http://www.misscosmic.com/ecotecture[/url].

I copied the script another time.
Now the thumbnails show up as I would like them to.
Only the main-picture is missing because of a conflict I guess.

What could I do to put more than one properly working gallery’s in one page.

Thanks a lot in advance!

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@JMRKERMar 15.2009 — See if you can use this directly or modify to suit your needs better. ?
<i>
</i>&lt;html&gt;
&lt;head&gt;
&lt;title&gt;Multiple Galleries&lt;/title&gt;
&lt;script type="text/javascript"&gt;
// From: http://www.codingforums.com/showthread.php?t=154649

var Fortunato = [
['http://www.westsierrahanoverians.com/images/fortunato_foal2.jpg','3 days old'],
['http://www.westsierrahanoverians.com/images/fortunato_foal.jpg','3 monhs old'],
['http://www.westsierrahanoverians.com/images/fortunato_canter.jpg','Canter'],
['http://www.westsierrahanoverians.com/images/forunato_trot.jpg','Trot'] // Note: NO comma after last entry
];
var Mares = [
['http://www.westsierrahanoverians.com/images/wakanova_conf.jpg','Wakanova'],
['http://www.westsierrahanoverians.com/images/princess_canter.jpg','Princess'],
['http://www.westsierrahanoverians.com/images/dona_fran_trot.jpg','Dona Fran trot'],
['http://www.westsierrahanoverians.com/images/wakanova_trot2.jpg','Wakanova trot']
];

function SetImage(IDS,imgPtr) {
var ids = '';
var ImageList = new Array();
if (IDS.indexOf('F') == 0) { ImageList = Fortunato; ids = 'BigFortunato'; }
if (IDS.indexOf('M') == 0) { ImageList = Mares; ids = 'BigMares'; }
document.getElementById(ids).src=ImageList[imgPtr][0];
document.getElementById(ids).alt=ImageList[imgPtr][0];
document.getElementById(ids+'Caption').innerHTML = ImageList[imgPtr][1];
}
function InitFortunato() {
for (var i=0; i&lt;Fortunato.length; i++) {
document.write('&lt;img id="FC'+i+'" src="'+Fortunato[i][0]+'" alt="'+Fortunato[i][0]+'"'
+ ' height="75" width="75" onmouseover="SetImage(this.id,'+i+')"&gt;');
}
}
function InitMares() {
for (var i=0; i&lt;Mares.length; i++) {
document.write('&lt;img id="MC'+i+'" src="'+Mares[i][0]+'" alt="'+Mares[i][0]+'"'
+ ' height="75" width="75" onmouseover="SetImage(this.id,'+i+')"&gt;');
}
}
&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;table border="1"&gt;&lt;tr&gt;
&lt;td&gt; &lt;img id="BigMares"
src='http://www.westsierrahanoverians.com/images/wakanova_conf.jpg'
alt='http://www.westsierrahanoverians.com/images/wakanova_conf.jpg'
<i> &gt;</i>
&lt;br&gt;&lt;span id="BigMaresCaption"&gt;Mares Caption&lt;/span&gt;
&lt;br&gt;&lt;span&gt; &lt;script type="text/javascript"&gt;InitMares()&lt;/script&gt; &lt;/span&gt;
&lt;/td&gt;

&lt;td&gt; &lt;img id="BigFortunato"
src='http://www.westsierrahanoverians.com/images/fortunato_foal2.jpg'
alt='http://www.westsierrahanoverians.com/images/fortunato_foal2.jpg'
<i> &gt;</i>
&lt;br&gt;&lt;span id="BigFortunatoCaption"&gt;Fortunato Caption&lt;/span&gt;
&lt;br&gt;&lt;span&gt; &lt;script type="text/javascript"&gt;InitFortunato()&lt;/script&gt; &lt;/span&gt;
&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/body&gt;
&lt;/html&gt;

Post back if you have questions or problems.

?
Copy linkTweet thisAlerts:
@missisipsiauthorMar 15.2009 — thnx JMRKER. Apreciated... But I so would like the one I use already.. so the question my question is still there..
Copy linkTweet thisAlerts:
@JMRKERMar 15.2009 — thnx JMRKER. Apreciated... But I so would like the one I use already.. so the question my question is still there..[/QUOTE]

It's OK. Your choice.

You can use one that works or you can use yours that doesn't

Good Luck!

?
×

Success!

Help @missisipsi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...