You are here: Re: Replacing text with mouseover? « HTML « IT news, forums, messages
Re: Replacing text with mouseover?

Posted by Jonathan N. Little on 08/24/05 16:32

Neredbojias wrote:
<snip>
>
> 1. ID the remote block of text.
>
> 2. Create a function/2 functions called by your mouseover events (-
> instead of putting the js right in the "onmouseover" link if that's what
> you do now.)
>
> 3. In the function(s), do the innerHTML thing to change the text in the
> ided larger block of text as well as whatever it is you do with the
> mouseovers now.
>
> Example:
>
> In the function(s) include:
>
> document.getElementById('lgtxtblock').innerHTML="AES does *not* stand
> for 'Ants Eat Shit.'"'
>

Small point, *innerHTML* is a MSIE property. Many browsers now include
it by demand. The W3C compatible way would be with *nodeValue*:

var el=document.getElementById('lgtxtblock');
el.firstChild.nodeValue="AES does *not* stand for 'Ants Eat Shit.'";

Added benifit, your script may be markedly faster!
http://www.gtalbot.org/DHTMLSection/innerHTMLvsNodeValue.html

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация