![]() |
|
|
|
Click here for a list of Dr. Website's most frequently asked questions (and answers!). Dr. Website® Archives 2001August 16, 2001
Dear Dr. Website: Is is possible to add a different link to each frame of an animated gif? We currently use a cgi script to rotate banner ads every time the page is refreshed, but the advertisers don't like the fact that they need to refresh the page a few times before their ad appears. Each gif has a unique link to the advertisers sites. Any help would be appreciated.
Answer: -- Dr. Website
Question: I use the following code on my site to have photos pop up when a visitor clicks on a thumbnail. ---------- function popupwin(ImageName,Desc,Date,Location) { var PicDir = "./pix/"; var PicHTML = "";
PicHTML += "<html>\n<head>\n<title>\n</title>\n</head>\n"; PicHTML += "<body background='./bindertile1.gif'>\n<BLOCKQUOTE><BLOCKQUOTE>\n<table border='1' cellpadding='3'>\n"; PicHTML += "<tr><td colspan='2' align='center'><img src='" + PicDir + ImageName + "'></td></tr>\n"; PicHTML += "<tr><td colspan='2' align='center'><b>" + Desc + "</b></td></tr>\n"; PicHTML += "<tr><td><b>Location: </b>" + Location + "</td>"; PicHTML += "<td><b>Date: </b>" + Date + "</td></tr>\n"; PicHTML += "</table>\n</BLOCKQUOTE></BLOCKQUOTE>\n</body>\n</html>";
---------- No problems with the code - it works well. I have several java scripts in a folder called "Java" and references to the folders on my various pages. The above script refers to: var PicDir = "./pix/"; I now have some additional photos in a folder called /chinaphotos. I can get the script to work with either folder but not with two of them. I am an amateur at this and the answer is probably obvious but I've spent hours trying to get it to work right with no success. Your help would be much appreciated. thanks,
Answer: function popupwin(Dir,ImageName,Desc,Date,Location) { var PicDir = Dir;
then just place the dir name where you call the function, like this: popupwin("chinaphotos","pic1.jpg","this is my pic","June1","china") -- Dr. Website
Question:
Great Web site.
Answer: -- Dr. Website
Visit The Dr. Website® Archives. Click here for a list of Dr. Website's most frequently asked questions (and answers!). Send your own question to Dr. Website®.
|
|
|||||||||||||||||||||||||||||||||||||||