Closed Thread Icon

Topic awaiting preservation: swap image script problems... help?! (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=8078" title="Pages that link to Topic awaiting preservation: swap image script problems... help?! (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: swap image script problems... help?! <span class="small">(Page 1 of 1)</span>\

 
arlechinu
Bipolar (III) Inmate

From: dunno, really dunno anymore...
Insane since: May 2001

posted posted 02-15-2002 11:32

www.chez.com/arlechinu/main.htm
this is where i've been using a swap image script
but the problem is that i can't make it work the way i want

let me explain:
on mouse over -> a double swap image
on mouse out -> another double swap image (back to the initial state)

BUT, i want an on click thing that keeps one of the two swaps and does not return to the initial state
maybe if you take a look at the code you'll understand better what i'm talking about here...

i understand that the problem is the on mouse out command that switches the pic to the initial state, but i don't seem to be able to make the pic remain in the way it is after the on mouse over...

if you look at the page, the 5 small buttons on the small interface have a on mouse over and an on mouse out behaviour; what i want to do is to make one of the swaped images stay swaped on click...

and the problem remains... even if i could make the pic stay swaped, the other on mouse over behaviours would not work because the src of the title pic is changed (so it is not the blank pic's src)

could anyone here take a look at the code and tell me if i'm doing something wrong?




The worst vice is advice...

Bugimus
Maniac (V) Mad Scientist

From: New California
Insane since: Mar 2000

posted posted 02-15-2002 17:38

I don't have enough time right now to go through your code but let me offer a few ideas.

When you click on any choice you should switch to that page *and* save the image id of that page in a temporary variable. Then every time you do an onmouseout, instead of swapping in the id of the blank image just swap in the id of the id in your temporary variable. I think that would do what you want. Does that make sense?

hecster2k
Nervous Wreck (II) Inmate

From: sj, ca, usa
Insane since: Feb 2002

posted posted 02-15-2002 17:51

how about setting a temp variable that sets to 'true' if clicked. then on your mouseout code, swap back if the image clicked was not set to true. does that make sense?

InI
Paranoid (IV) Mad Scientist

From: Somewhere over the rainbow
Insane since: Mar 2001

posted posted 02-15-2002 18:31

The poster has demanded we remove all his contributions, less he takes legal action.
We have done so.
Now Tyberius Prime expects him to start complaining that we removed his 'free speech' since this message will replace all of his posts, past and future.
Don't follow his example - seek real life help first.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-15-2002 23:55

Alright I get it.

Try this, change your links to look like this:

code:
<area shape="rect" coords="0,50,8,57" href="javascript: void(0)" onclick="changeActive(0 ,'about')" onMouseOver="newscreen('title1','about'); newscreen('thingy1','thingy2')" onMouseOut="newscreen('title1','title'); newscreen('thingy1','thingy')" >


Then change the changeActive funtion to look like so.

code:
function changeActive(num, objectsrc){
oScroll[active].css.visibility='hidden'
active=num
oScroll[active].css.top=0
oScroll[active].css.visibility='visible'
title.src = eval(objectsrc+".src")
}




Does this make sense?

I think it's the effect you are going for, trying to keep the active section Title in the bar.



:[ Computers let you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila. ]:

RoyW
Bipolar (III) Inmate

From:
Insane since: Aug 2001

posted posted 02-16-2002 23:06

I think Bugimus solution is the simplest, use a single global var.

in the HEAD javascript put

var defaultTitle = "title";

then simply change your links to

<area shape="rect" coords="0,50,8,57" href="#"
onclick="changeActive(0);defaultTitle='about'"
onMouseOver="newscreen('title1','about'); newscreen('thingy1','thingy2')"
onMouseOut="newscreen('title1',defaultTitle); newscreen('thingy1','thingy')" >

<area shape="rect" coords="0,58,8,65" href="#"
onclick="changeActive(1;defaultTitle='resources')"
onMouseOver="newscreen('title1','resources'); newscreen('thingy1','thingy2')"
onMouseOut="newscreen('title1',defaultTitle); newscreen('thingy1','thingy')">

arlechinu
Bipolar (III) Inmate

From: dunno, really dunno anymore...
Insane since: May 2001

posted posted 02-17-2002 13:48

www.chez.com/arlechinu/main2.htm

bitdamaged, thanx!
it works just fine now!
and RoyW... your solution is kinda the same... anyway, they both work, but i really am too bored to edit the source again so i'll just leave it as bitdamaged suggested
thanx anyway!

e, InI, mi dispiace ma io non parlo italiano...


The worst vice is advice...

« BackwardsOnwards »

Show Forum Drop Down Menu