# Out of the topic question

**URL:** <https://forum.kirupa.com/t/out-of-the-topic-question/15449>\
**Category:** Uncategorized\
**Created:** [March 14, 2003, 7:07am UTC](https://forum.kirupa.com/t/out-of-the-topic-question/15449 "2003-03-14T07:07:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![lairusi](https://avatars.discourse-cdn.com/v4/letter/l/ac91a4/32.png) [@lairusi](https://forum.kirupa.com/u/lairusi)\
**Post date:** [March 14, 2003, 7:07am UTC](https://forum.kirupa.com/t/out-of-the-topic-question/15449/1 "2003-03-14T07:07:02Z")

</div>

I know I’m out of the topic, but when I tried to post this question in the other section, nobody want to anwer me. So, I decided to post this question in this section. Ok, here’s my question…

Can anyone teach me how to the effect in [EG’s website](http://www.electrongeek.net) the enter button in the splash screen. That when I rolled over the enter button, it changes into another picture.

[size=4][color=Red]Thanks in advance!!![/color][/size] :beam:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 7:26am UTC](https://forum.kirupa.com/t/out-of-the-topic-question/15449/2 "2003-03-14T07:26:31Z")

</div>

ok… this is rather easy, but belongs in the server side scripting section. I do not have the code in front of me… but It’s a roll over javascript. That means that you can view the code using view source. It’s not a flash effect.

first he initializes the images with some functions in the prescript script.

```auto
<SCRIPT TYPE="text/javascript">
<!--

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments*].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		enter_over = newImage("images/enter-over.gif");
		preloadFlag = true;
	}
}

// -->
</SCRIPT>
<!-- End Preload Script -->

```

then in the body of the page, he has a table and in one of the cells he has this.

```auto

			<A HREF="center.html" TARGET="_self"
				ONMOUSEOVER="changeImages('enter', 'images/enter-over.gif'); return true;"
				ONMOUSEOUT="changeImages('enter', 'images/enter.gif'); return true;">
				<IMG NAME="enter" SRC="images/enter.gif" WIDTH=83 HEIGHT=89 BORDER=0 ALT=""></A>

```

I cannot fully explain how this works… you need to look up a tutorial on image changing for javascript. I would also suggest looking at EG’s source code fully. It may reveal more to you.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 7:29am UTC](https://forum.kirupa.com/t/out-of-the-topic-question/15449/3 "2003-03-14T07:29:17Z")

</div>

It may be that someone else can explain this better. I could do it in more simple terms than EG has done, if I was at home with my books.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [March 14, 2003, 7:42am UTC](https://forum.kirupa.com/t/out-of-the-topic-question/15449/4 "2003-03-14T07:42:26Z")

</div>

Thanks! 🙂
