Forum Moderators: open

Message Too Old, No Replies

need help handling text

want to display dynamic text

         

webmouse

12:51 am on Jan 31, 2005 (gmt 0)

10+ Year Member



I am building a website using javascript. I have thumbnails on the page with one large image. onmouseover I change the large image to match the thumbnail. I also want to change the text description below the large image. I can't figure out how to dynamically change the text. onmouseover I call a function that just sets document.all.largeImage.src = 'largeImagexx';

I'm using a table with the <img name='largeImage'...> for the image.

Any ideas on changing text under the image?

orion_rus

2:09 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



U can make any decisions from the following:
1.U can have a input with type="text" and as u know a src of the image u're ofcause know a needed text and simple change value of this input)
2.u can make make any span container, and each time when the image is changing change the HTML of this container with innerHTML function
3.U can create object with text dinamycally, replacing the previos one with the new one with function oTextNode=document.createTextNode("New Text");
and make replace after
oItem1.firstChild.replaceNode(oTextNode);
in the container
<UL>
<LI ID = oItem1 />List Item 1
</UL>

I hope i help you, good luck to you

webmouse

5:47 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



Thanks orion_rus. I was going to investigate the innerHTML, but I had not used that before. I like the text object and will try it first. Thanks again! :-)

orion_rus

7:54 pm on Jan 31, 2005 (gmt 0)

10+ Year Member



No problem) innerHTML is good in a crossbrowsing too) but if i was on your place i think i choose replace child method)
Good luck to you