Computing.Net > Forums > Web Development > Text swapping

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Text swapping

Reply to Message Icon

Name: Relik
Date: July 8, 2004 at 08:17:11 Pacific
OS: Windows XP
CPU/Ram: 1024 MB
Comment:

Y'know how Javascript can swap pictures onmouseover? Well, I want to do that with text (particularly text files, but any sort of text will do)...is it possible without using Flash?

Thanks in advance and sorry if this question has already been answered...I searched, but couldn't find it.



Sponsored Link
Ads by Google

Response Number 1
Name: Don Arnett
Date: July 8, 2004 at 09:47:55 Pacific
Reply:

look into the 'innerText' or 'innerHTML' attributes of various objects.

For example, I believe that you can change the contents inside a table cell by changing the innerText/innerHTML attributes.


Another approach, if you are just swapping some text back and forth between two (or a small number) of values, is to create a DIV for each text value and then show and hide them. For example, you create to DIVs of the same size and location and put different text into each one. You set one to be hidden and one shown, then swap the show/hide values.

It's been a while since I've done this so I can't give more specific answers.

Look around www.dynamicdrive.com and you might find some examples.

Also, doing this type of thing and keeping compatible with non-IE browsers takes some work. If you choose not to support pre-IE 4 and pre-Netscape 6, it will make your compatibility issues easier to deal with.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Text swapping

Javascript cross-frame image swap www.computing.net/answers/webdevel/javascript-crossframe-image-swap/2582.html

Hiding and Unhiding text www.computing.net/answers/webdevel/hiding-and-unhiding-text/2376.html

make text always show up on bottom www.computing.net/answers/webdevel/make-text-always-show-up-on-bottom/529.html