<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>I had a similar problem with some expand-colapse objects that would <BR>
hide the previously shown title content while expanding the content <BR>
of currently clicked title, etc.<BR>
&nbsp;<BR>
Lots of ideas came through my mind; like using numbered ids, or loop the <BR>
collection to reset all before expanding the clicked title, etc, but I droped<BR>
them all before my last decision.<BR>
I had some real headache with it, eventhough the idea was simple, it <BR>
required a hell of&nbsp;testing and rewritting both html, css,&nbsp;even script statements<BR>
mostly because of nested elements.etc<BR>
&nbsp;<BR>
The idea was to use a 'global var' as a "short term memory"&nbsp;cell&nbsp;for keeping track<BR>
of&nbsp;the last expanded element until new title&nbsp;is clicked. Yet at the end I was forced<BR>
to rewrite it all&nbsp;to make this aproach&nbsp;work&nbsp;on different browsers.<BR>
<BR>So, what I will&nbsp;bring you&nbsp;here, is a very simple and modified script of the same <BR>
aproach that should solve your problem. I'm using classes here to shorten your <BR>
script and possibly make it easier to read.<BR>
The Script:<BR>
&nbsp;<BR>
var current='';<BR>
&nbsp;<BR>
function persist(actual) {<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (actual.target) <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actual=actual.target<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else <BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; actual=actual.srcElement<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if (actual.className=="borderOff")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current.className="borderOff"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actual.className="borderOn"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;current=actual<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<BR>
&nbsp;<BR>
The HTML code:<BR>
&nbsp;<BR>
&nbsp;&lt;img src='...'&nbsp;class='borderOff' onMouseOver="persist(event)"&gt;<BR>&nbsp;&lt;img src='...' class='borderOff' onMouseOver="persist(event)"&gt;<BR>&nbsp;&lt;img src='...<BR>
&nbsp;<BR>
The CSS:<BR>
&nbsp;<BR>
.borderOn{<BR>&nbsp;border: solid 2px red;<BR>
}<BR>
.borderOff{<BR>&nbsp;border:none;<BR>
}<BR>
&nbsp;<BR>
This way you can chose&nbsp;what image&nbsp;gets the behaviour so that other ordinary <BR>
images&nbsp;remain excluded in a 'clean' way.<BR>
&nbsp;<BR>
ps.:<BR>
Reading earlier questions I find that you are using different bored colors!<BR>
In casse it's important, I propose you do the following:<BR>
&nbsp;<BR>
Youll have to first add&nbsp;Id's to the images so the border-color is specified<BR>
through "Id" selector in css.<BR>
&nbsp;<BR>
Asuming image Id's are&nbsp;given as follows: border1,..2,..3, etc, all you have to do is,&nbsp;<BR>
-add these extra css lines: <BR>
&nbsp;<BR>
#border1{<BR>&nbsp;border-color:red;<BR>
}<BR>#border2{<BR>&nbsp;border-color:green;<BR>
}<BR>#border3{<BR>&nbsp;border-color:blue;<BR>
}<BR>
...<BR>
&nbsp;<BR>
While off course, your image tags will&nbsp;become:<BR>
&nbsp;&lt;img src='...'&nbsp; id='border1' class='borderOff' onMouseOver="persist(event)"&gt; a.s.o.<BR>
&nbsp;<BR>
That's all!<BR>
If you&nbsp;decide use it, I would be glad if you&nbsp;add my signiture&nbsp;to it,<BR>
dont thank me. :)<BR>
&nbsp;<BR>
Regards,<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Troy III <BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; progressive art enterprise<BR>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR><BR><BR><BR>

<HR id=stopSpelling>
<BR>
&gt; Date: Sat, 6 Oct 2007 11:14:24 -0400<BR>&gt; To: javascript@lists.evolt.org<BR>&gt; From: tedd@sperling.com<BR>&gt; Subject: [Javascript] Maintaining state<BR>&gt; <BR>&gt; Hi gang (again):<BR>&gt; <BR>&gt; I hope that my flurry of recent questions is not abusing your <BR>&gt; kindness. If so, please tell me.<BR>&gt; <BR>&gt; Here's the situation.<BR>&gt; <BR>&gt; Let's say there are three images on a web page such that when the <BR>&gt; user moves his/her cursor over one image, a border appears. No <BR>&gt; problem, I can do that with css.<BR>&gt; <BR>&gt; However, I would like the border to remain (i.e., maintain state) <BR>&gt; after the user has moved the cursor off the image and stay that way <BR>&gt; until another image is subject to a rollover -- and then, that image <BR>&gt; would maintain state. Only one image maintains state.<BR>&gt; <BR>&gt; I know this is counter to the way css does things, but it's not so <BR>&gt; much in application HIG (human interface guidelines), where <BR>&gt; maintaining state is common.<BR>&gt; <BR>&gt; I am sure that I could stumble around and come up with something, but <BR>&gt; I would think this would be more of a staple function/method commonly <BR>&gt; used by javascript experts (how's that for kissing up?).<BR>&gt; <BR>&gt; In any event, if any of you have encountered this before, I would <BR>&gt; appreciate guidance.<BR>&gt; <BR>&gt; Thanks,<BR>&gt; <BR>&gt; tedd<BR>&gt; <BR>&gt; -- <BR>&gt; -------<BR>&gt; http://sperling.com http://ancientstones.com http://earthstones.com<BR>&gt; _______________________________________________<BR>&gt; Javascript mailing list<BR>&gt; Javascript@lists.evolt.org<BR>&gt; http://lists.evolt.org/mailman/listinfo/javascript<BR><BR><br /><hr />Windows Live Hotmail and Microsoft Office Outlook – together at last. <a href='http://office.microsoft.com/en-us/outlook/HA102225181033.aspx?pid=CL100626971033' target='_new'>Get it now!</a></body>
</html>