PDA

View Full Version : Anyone know how to


ChasDevlin
03-06-2003, 04:46 PM
Hi,

Trying to find a script (DHTML or JavaScript) to enable text to appear in one place via a clicked thumbnail image (in an iFrame).

I think I can create an empty div tag where I want the text caption to be:

ex :

then: add an extra js function to my thumbnail onClick
ex : onclick="showText('captio n','lorem ipsum blah blah')"

but I have no idea how to write the actual showText javascript function to perform a document.write

Does anyone know how to do this? Any help is appreciated! The test site is up at:
http://www.sleazerama.com/NT_test/test.htm

Cheers :)

joeframbach
03-06-2003, 05:21 PM
<!-- ************ start photo caption -->
<tr>
<td colspan="2" bgcolor="#F5F5F5" id="textCaption"><b>TEXT SHOULD APPEAR HERE WHEN CLICKING ANY THUMBNAIL IN iFRAME (on RIGHT)...</b></td>
</tr>
<!-- ************ end photo caption -->



function myClick(img) {
parent.hold.src = "gfx/" + img;
parent.textCaption.innerHTML=img;
// alert (parent.hold.document.hold.src);
}


i think this will work, if you know where to put it.

ChasDevlin
03-06-2003, 06:45 PM
Hey Joe,

Cheers for the reply. Put the code in but still not working, I'm sure I'm missing one vital piece. If you have time, please take a look at the page(s) again. Very much appreciated...

Not sure my initial thing was right...

http://www.sleazerama.com/NT_test/test.htm

joeframbach
03-08-2003, 01:54 AM
looks like it works.... what do you see thats wrong?:confused:

ChasDevlin
03-08-2003, 06:41 AM
hey joe,

actually, since that last post, i got it to work with a very similar script -- albeit without the div bit. it took a while for me to keep hacking away (during work!) and make it all connect .

anyway, cheers for help. very much appreciated.

jj