Skip to content

Instantly share code, notes, and snippets.

@aerith
Created July 29, 2009 08:23
Show Gist options
  • Save aerith/157934 to your computer and use it in GitHub Desktop.
Save aerith/157934 to your computer and use it in GitHub Desktop.
<html>
<head>
<script type="text/javascript">
<!--
var $ = function (id) { return document.getElementById(id); };
window.onload = function () {
var images = $('image-list').getElementsByTagName('img');
for ( var i = 0; i < images.length; i++ ) {
var image = images[i];
image.onmouseover = function () { this.src = this.src.replace('static', 'active'); };
image.onmouseout = function () { this.src = this.src.replace('active', 'static'); };
image.onclick = function () { $('image-body').firstChild.src = this.src.replace('active', 'large'); }
}
};
-->
</script>
</head>
<body>
<p id="image-body"><img src="spacer.gif"></p>
<ul id="image-list">
<li><img src="1_static.gif"></li>
<li><img src="2_static.gif"></li>
<li><img src="3_static.gif"></li>
<li><img src="4_static.gif"></li>
<li><img src="5_static.gif"></li>
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment