Out of the topic question

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 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:

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.

<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.


			<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.

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.

Thanks! :slight_smile: