Hi All
My apologies if this appears to be simple to some of you but I have
very little experience of javascript and I cannot work this one out,
The code below is a nice piece of code I found on the web to rotate a
set of images. It works very well.
However, I would like to place a value in the HREF which points to a
larger version of the image currently being displayed
Example
The image being displayed may be a thumbnail tn_image1.jpg
I would like the HREF point to the image image1.jpg (the images will
always be the same name as the thumbnails but without the tn_ prefix).
Any help would be gratefully received
Iain
+++++++++++++++ +++++++++++++++ +++++++++++++++ +++++++++++++++ +
<%@LANGUAGE="VB SCRIPT"%>
<%
DIM objFSO, objFile, objFileTextStre am, ImageCount
Set objFSO = CreateObject("S cripting.FileSy stemObject")
LPP=server.MapP ath("teegan.txt ")
Set objFile = objFSO.GetFile( LPP)
Set objFileTextStre am = objFile.OpenAsT extStream(1)
%>
<html>
<head>
<script language="JavaS cript">
<!-- // Hide from old browsers --
/* This is a transition banner rotating script uses IE filters.
Netscape does a simple image swap */
var step=1
var speed=2 /* change speed below (in seconds) this value
determines how long each banner remains before it is changed */
/* =============== ============ IMAGES =============== ========== */
/* Begin Edit Here
*/
/* Source found at
http://www.havenofbliss.com/javascript/banner.html */
/* Add images as needed, but remember to update the number of
images variable */
/* =============== =============== =============== =============== */
<%
ImageCount=1
Do while objFileTextStre am.AtEndOfStrea m <> True
StrLine=objFile TextStream.Read Line
if StrLine<>"" then
%>
var image<%=ImageCo unt%>=new Image()
image<%=ImageCo unt%>.src='<%=t rim(StrLine)%>'
<%
ImageCount=Imag eCount+1
end if
loop
objFileTextStre am.Close
%>
var number_of_image s = <%=ImageCount-1%>
var name_of_image = <%=trim(StrLine )%>
window.onerror= reapply
function reapply()
{
/* Incase of an error, restart banner rotation */
setTimeout("sli deit()",2000);
return true;
}
function slideit()
{
if (!document.imag es)
return;
if (document.all)
slide.filters.b lendTrans.apply ();
document.images .slide.src=eval ("image" + step + ".src");
if (document.all)
slide.filters.b lendTrans.play( );
if (step < number_of_image s)
step++;
else
step=1;
if (document.all)
setTimeout("sli deit()", speed * 1000 + 3000);
else
setTimeout("sli deit()", speed * 1000);
}
</script>
<title>Rotati ng Images</title>
</head>
<body onLoad="slideit ();">
<!-- The following image tag is the place holder for the banner
-->
<br><br><br><br ><br>
<center>
<A HREF = HOW DO I DERIVE THIS>
<IMG name = slide src = "background001. jpg" style =
"FILTER: blendTrans(dura tion = 3)"><br>IMAGE NAME</A>
</center>
</body>
</html>