PDA

View Full Version : do file extensions names have to be same as actual link on web page?



danno
05-11-2007, 11:33 PM
1) Script Title: IMAGE w/DESCRIPTION TOOLTIP

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex4/imagetooltip.htm

3) Describe problem:
I have images I want to display using this script which are all in a folder. They are respectively:
photo1.gif, photo2.gif etc. etc.

When I create my text link on the page for photo1.gif , I was wondering if I can use another wording, such as DOG IMAGE1, DOG IMAGE2 etc.?
In essence, is it necessary for the file extension name of the image in the folder I have it stored to be the same as the text it applies to on the actual web page?

jscheuer1
05-12-2007, 02:40 AM
The only places in HTML and in javascript code where the actual filenames are required are those places where the browser needs to know where to find the file. Things like:


src=

and:


href=

and (the red part) here:


messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");

In areas where it is just text that the user sees, you can type anything you like in those places:


>Text the User Sees<

and (the green part) here:


messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");

thetestingsite
05-12-2007, 03:00 AM
Also; in addition to what John pointed out above, you can point your anchors (<a> tags) to any page/file you want as long as the image that you want displayed in the tooltip is defined in the javascript code. In other words, you could place a link on your page like so:



<a href="test.html" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">Some text</a>


Then in the javascript that defines the tooltip content, you could have this:



messages[0] = new Array('red_balloon.gif','Here is a red balloon on a white background',"#FFFFFF");


Hope this helps.

danno
05-13-2007, 01:57 PM
will I be able to link the file extension name of dog2.gif to DOG IMAGE link text that's on the actual page? Can you recommend the best way? I really appreciate it. Normally, I'll upload my folder of images identified with all appropriate dog3.gif, dog4.gif etc. Then on my page, type the text link of DOG IMAGE1 (for dog1.gif) etc. Correct? So, best way to link is?

thetestingsite
05-13-2007, 02:13 PM
I'm not quite sure I understand what you want to do, but I think this is what you mean:



<a href="dog1.gif" onmouseover="doTooltip(event,0)" onmouseout="hideTip()">DOG IMAGE 1</a>


Then in the script itself, place this:



messages[0] = new Array('dog1.gif','This is the image of dog 1',"#FFFFFF");


Hope this helps.

danno
05-14-2007, 12:01 PM
Hi Testing Site:
Here is what I want to do......upload a folder of images to my frontpage web and all images in folder are identified with file extension names of dog1.gif, dog2.gif, dog3.gif, dog4.gif, dog5.gif etc. etc.
On my page where I intend to have visitors mouseover the text, and have those intended images pop up, I want dog1.gif to show when mousing over the word I type on the page, being DOG PHOTO1 and I want dog2.gif to show when mousing over DOG PHOTO2 etc. etc.
So in essence, can I do this according to your instructions? Thanks for all the assistance.

thetestingsite
05-14-2007, 02:58 PM
Yes, what I posted above will do the trick for you.

danno
05-14-2007, 04:11 PM
Thank YOU TS, for kicking butt on my question . . . .