...

View Full Version : Image issues with script pasted into FrontPage



alexd225
06-02-2004, 12:48 AM
I am not a programmer, so please excuse me if this is dumb, but I have truly searched to try to find an answer. I built my website with Frontpage, and wanted to add a slide show. I found several great scripts on Dynamic Drive. When I paste them, and define the necessary variables, they work great in "Preview" mode in FP, but the images do not appear when the website is posted. I suspect there is a problem in how I'm defining images (I am not linking them). This has happened to all 3 of the various scripts I have tried. Can someone tell me what I'm doing wrong??
Thanks in advance.
Alex

bradyj
06-02-2004, 01:04 AM
Usually find that when I don't write the source of the image in the directory properly. Can you post us your code? Put it in [code] brackets. Or a link would do, but I'm guessing it's just that, I always forget about that still:)

alexd225
06-02-2004, 01:18 AM
Thanks bradyj
To follow is the code i pasted. I also created a child page to this one, where I loaded all of the .jpg images listed in the array, so that they would be listed in the FP folder list (which they are).
[
<html>

<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Slide Show</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="Microsoft Theme" content="copy-of-poetic 011, default">
<meta name="Microsoft Border" content="t, default">
</head>

<body>
<p>This page currently under construction. Visit here again soon.</p>
<p align="center"><input type="button" id="btnPrev" value="<< Previous" onclick="Prev();"> <input type="button" id="bntPlay" value="Play - Stop" onclick="Play()"> <input type="button" id="btnNext" value=" Next >> " onclick="Next();"></p>

<p align="center"><img id="_Ath_Slide" onload="OnImgLoad()"> </p>

<p align="center"><b>Description:</b> <SPAN id="_Ath_FileName"> </SPAN> <br>
<b>Number of Pictures: <SPAN id="_Ath_Img_X"></SPAN> of <SPAN id="_Ath_Img_N"></SPAN></b></p>

<p align="center">

<script language="JavaScript1.2">

/*
Interactive Image slideshow with text description
By Christian Carlessi Salvadó (cocolinks@c.net.gt). Keep this notice intact.
Visit http://www.dynamicdrive.com for script
*/


g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
if (fFwd)
{
if (++g_iimg==g_imax)
g_iimg=0;
}
else
{
if (g_iimg==0)
g_iimg=g_imax;
g_iimg--;
}
Update();
}

function getobject(obj){
if (document.getElementById)
return document.getElementById(obj)
else if (document.all)
return document.all[obj]
}

function Update(){
getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
getobject("_Ath_Img_X").innerHTML = g_iimg + 1;
getobject("_Ath_Img_N").innerHTML = g_imax;
}


function Play()
{
g_fPlayMode = !g_fPlayMode;
if (g_fPlayMode)
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
Next();
}
else
{
getobject("btnPrev").disabled = getobject("btnNext").disabled = false;

}
}
function OnImgLoad()
{
if (g_fPlayMode)
window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}
function Tick()
{
if (g_fPlayMode)
Next();
}
function Prev()
{
ChangeImage(false);
}
function Next()
{
ChangeImage(true);
}


////configure below variables/////////////////////////////

//configure the below images and description to your own.
g_ImageTable[g_imax++] = new Array ("Angie2.jpg", "This is our receptionist, Angie. She will make your appointment for you!");
g_ImageTable[g_imax++] = new Array ("Lipo team.jpg", "Bike Rider.");
g_ImageTable[g_imax++] = new Array ("Infusion2.jpg", "Soccer Player.");
g_ImageTable[g_imax++] = new Array ("Aspiration2.jpg", "Watch Out!!");
g_ImageTable[g_imax++] = new Array ("Fat in tubing.jpg", "Hurry Up!");
g_ImageTable[g_imax++] = new Array ("Canister2text.jpg", "Hurry Up!");

//extend the above list as desired
g_dwTimeOutSec=5

////End configuration/////////////////////////////

if (document.getElementById||document.all)
window.onload=Play

</script>
</p>

<p align="center"><font face="Arial" size="-2">Free DHTML scripts provided by<br>
<a href="http://dynamicdrive.com">Dynamic Drive</a></font></p>
</body>

</html>
]

bradyj
06-02-2004, 04:09 AM
Where are the images saved in relation to this document? In the same folder? In subfolders? Like:
images -- personal -- pictures

alexd225
06-02-2004, 02:20 PM
I saved all the images in a subfolder, and they do appear under the folder tab in FrontPage, but somehow when the site is posted, it is not finding the images. Thanks

bradyj
06-02-2004, 04:44 PM
I saved all the images in a subfolder, and they do appear under the folder tab in FrontPage, but somehow when the site is posted, it is not finding the images. Thanks

Bingo -- there is most likely a problem with these lines that have your images then:


g_ImageTable[g_imax++] = new Array ("Lipo team.jpg", "Bike Rider.")


Any area that says you image name, needs to have the exact file location. Say I save my home page index.html next to a folder called images, and I want to link to those images, then I'd have to write the array:


g_ImageTable[g_imax++] = new Array ("images/Lipo team.jpg", "Bike Rider.")


or sometimes with javascript:


g_ImageTable[g_imax++] = new Array ("./images/Lipo team.jpg", "Bike Rider.")


Make sense? if you have a folder beneath a folder, then:


g_ImageTable[g_imax++] = new Array ("images/pictures/Lipo team.jpg", "Bike Rider.")


or



g_ImageTable[g_imax++] = new Array ("./images/pictures/Lipo team.jpg", "Bike Rider.")


That's probably it, can't find the images. I hate frontpage, by the way, it should do this for you. If you have them saved right next to the html page without a subfolder, then it would be your original or:


g_ImageTable[g_imax++] = new Array ("./Lipo team.jpg", "Bike Rider.")

NEExt
06-02-2004, 06:30 PM
I always have a similar problem, but for me its because Frontpage doesn't seem to care about caps when referencing images, but my web host does.

Digital camera exports as .JPG, photoshop converts to .jpg on a save, and I'm always mixing them up.

alexd225
06-04-2004, 01:33 AM
Thanks you guys for all your help. I haven't gotten it to work yet, but I'm still trying. I know it has something to do with how I am referencing my images. Thanks also for the tip on JPG vs jpg. I was able to do a simplistic slide show using the Banner Marquis web component. I am learning that FrontPage is a funky little program. Do you guys like Dreamweaver better??
Alex ;)

bradyj
06-04-2004, 05:06 AM
Thanks you guys for all your help. I haven't gotten it to work yet, but I'm still trying. I know it has something to do with how I am referencing my images. Thanks also for the tip on JPG vs jpg. I was able to do a simplistic slide show using the Banner Marquis web component. I am learning that FrontPage is a funky little program. Do you guys like Dreamweaver better??
Alex ;)

Yeah, Dreamweaver is probably the lesser evil -- I started on DreamWeaver for a couple years, and it works great -- but I felt I was limited and moved on to hand coding. But if you were to pick a program to code for you, dreamweaver is it. It will easily understand your Javascript, as well as many other languages.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum