auntnini
07-24-2008, 10:13 PM
Hope to add captions for big images at http://jacquimorgan.tripod.com/hist/index.html#top)
Looking at http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm, the option to ”Specify whether TITLE attribute of thumbnail links should show as description under enlarged image” was appealing
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
But the <script> seemed overly complicated.
Would prefer a simpler approach -- for instance http://www.morgangaynin.com
<script language="JavaScript" type="text/javascript"> <!—
if (document.images) {
pic1 = new Image pic1.src = "images/pic_01.jpg" …
pic6 = new Image pic6.src = "images/pic_06.jpg"
holder = new Image holder.src = "images/holder.jpg"
}
else { document.pic1 = "" … document.pic6 = ""
document.holder = ""
}
</script>
Thumbnails in <BODY>
<img src="images/pic_01a.jpg" onMouseOver="document.holder.src=pic1.src">
<img src="images/pic_06a.jpg" onMouseOver="document.holder.src=pic6.src">
I’m trying to figure out how to add TITLES by adapting something like
<script type="text/javascript" >
/*http://www.alistapart.com/articles/imagegallery JavaScript Image Gallery by Jeremy Keith changes images and title */
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('MGholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
</script>
<BODY> link: <a onclick="return showPic(this)" href="Scott.jpg" title="Scott calendar"> Scott calendar </a> [Maybe add this under thumbnails?]
So I attempted (without success) variations of
MG1 =new Image(); MG1 = "<img src='03_Scott.jpg' title-'Scott' />";
MG2 = new Image(); MG2.src = '04_ManGoat.jpg';
<div id="space">
<img src="04_AmericanArtist.jpg" alt="MGholder" name="MGholder" hspace=0 vspace=0 border=1 class="MGholder" />
<p class="desc">Caption</p> </div> <!--closeSPACE-->
The other onclick ”loadpage” script on the THUMBNAILS is for a pop-window
<div id="thumbnails">
<a href="#nogo" onclick="javascript:loadpage('03_Scott.jpg');
return showPic(this);"
onMouseOver="MGOn('MG1')" title="Scott">
<img name="1" alt="Scott" src="03_Scott.jpg" title="Scott" /></a>
<a href="#" onclick="javascript:loadpage('04_ManGoat.jpg')"
onMouseOver="MGOn('MG2')" title="ManGoat">
<img name="2" alt="ManGoat" src="04_ManGoat.jpg" title="ManGoat" /></a></div>
Perhaps my whole approach is “muddled.”
Looking at http://www.dynamicdrive.com/dynamicindex4/thumbnail2.htm, the option to ”Specify whether TITLE attribute of thumbnail links should show as description under enlarged image” was appealing
var description=(thumbnailviewer2.enableTitle && linkobj.getAttribute("title"))? linkobj.getAttribute("title") : "" //Get title attr
But the <script> seemed overly complicated.
Would prefer a simpler approach -- for instance http://www.morgangaynin.com
<script language="JavaScript" type="text/javascript"> <!—
if (document.images) {
pic1 = new Image pic1.src = "images/pic_01.jpg" …
pic6 = new Image pic6.src = "images/pic_06.jpg"
holder = new Image holder.src = "images/holder.jpg"
}
else { document.pic1 = "" … document.pic6 = ""
document.holder = ""
}
</script>
Thumbnails in <BODY>
<img src="images/pic_01a.jpg" onMouseOver="document.holder.src=pic1.src">
<img src="images/pic_06a.jpg" onMouseOver="document.holder.src=pic6.src">
I’m trying to figure out how to add TITLES by adapting something like
<script type="text/javascript" >
/*http://www.alistapart.com/articles/imagegallery JavaScript Image Gallery by Jeremy Keith changes images and title */
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('MGholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
</script>
<BODY> link: <a onclick="return showPic(this)" href="Scott.jpg" title="Scott calendar"> Scott calendar </a> [Maybe add this under thumbnails?]
So I attempted (without success) variations of
MG1 =new Image(); MG1 = "<img src='03_Scott.jpg' title-'Scott' />";
MG2 = new Image(); MG2.src = '04_ManGoat.jpg';
<div id="space">
<img src="04_AmericanArtist.jpg" alt="MGholder" name="MGholder" hspace=0 vspace=0 border=1 class="MGholder" />
<p class="desc">Caption</p> </div> <!--closeSPACE-->
The other onclick ”loadpage” script on the THUMBNAILS is for a pop-window
<div id="thumbnails">
<a href="#nogo" onclick="javascript:loadpage('03_Scott.jpg');
return showPic(this);"
onMouseOver="MGOn('MG1')" title="Scott">
<img name="1" alt="Scott" src="03_Scott.jpg" title="Scott" /></a>
<a href="#" onclick="javascript:loadpage('04_ManGoat.jpg')"
onMouseOver="MGOn('MG2')" title="ManGoat">
<img name="2" alt="ManGoat" src="04_ManGoat.jpg" title="ManGoat" /></a></div>
Perhaps my whole approach is “muddled.”