<html>
<base href="http://www.cryokinesis.co.uk/demo/">
<head>
<style type="text/css">
<!--
#container {
background: #CCCCCC;
height: 75px;
width: 70%;
position: relative;
overflow: hidden;
}
#content {
position: absolute;
white-space: nowrap;
height: 75px;
left: 0px;
top: 0px;
}
-->
</style>
<script type="text/javascript">
// browser sniff
IE5=NN6=false
if(document.all){IE5=true}
else if(document.getElementById){NN6=true}
var containerDiv = null;
var contentDiv = null;
function moveHandler(e) {
if(typeof(e) == 'undefined') e = event;
mPosX = e.clientX - containerDiv.offsetLeft;
// sets the position of the content layer - N.B. 1500 is the total width of content
contentDiv.style.left = 0 - (1500-mPosX) / (containerDiv.offsetWidth / mPosX) + 'px'
}
function _attachToEvent(obj, name, func){
name = name.toLowerCase();
// Add the hookup for the event.
if(typeof(obj.addEventListener) != "undefined"){
if(name.length > 2 && name.indexOf("on") == 0) name = name.substring(2, name.length);
obj.addEventListener(name, func, false);
} else if(typeof(obj.attachEvent) != "undefined"){
obj.attachEvent(name, func);
} else {
if(eval("obj." + name) != null){
// Save whatever defined in the event
var oldOnEvents = eval("obj." + name);
eval("obj." + name) = function(e) {
try{
func(e);
eval(oldOnEvents);
} catch(e){}
};
} else {
eval("obj." + name) = func;
}
}
}
function ImageClicked(e){
if(typeof(e) == 'undefined') e = event;
var obj = (e.target)?e.target:e.srcElement;
alert("Handle Click on " + obj.src);
}
function init() {
// find divs
containerDiv = document.getElementById('container')
contentDiv = document.getElementById('content')
var arr = containerDiv.getElementsByTagName("img");
for(var i=0; i<arr.length; i++){
_attachToEvent(arr[i], "onmousemove", moveHandler);
_attachToEvent(arr[i], "onclick", ImageClicked);
}
}
</script>
</head>
<body onload="init()">
<div id="container">
<div id="content">
<img src="thumb0.jpg" width="75" height="75" border="0"/><img src="thumb1.jpg" width="75" height="75" border="0"/><img src="thumb2.jpg" width="75" height="75" border="0"/><img src="thumb3.jpg" width="75" height="75" border="0"/><img src="thumb4.jpg" width="75" height="75" border="0"/><img src="thumb5.jpg" width="75" height="75" border="0"/><img src="thumb6.jpg" width="75" height="75" border="0"/><img src="thumb7.jpg" width="75" height="75" border="0"/><img src="thumb8.jpg" width="75" height="75" border="0"/><img src="thumb9.jpg" width="75" height="75" border="0"/><img src="thumb10.jpg" width="75" height="75" border="0"/><img src="thumb11.jpg" width="75" height="75" border="0"/><img src="thumb12.jpg" width="75" height="75" border="0"/><img src="thumb13.jpg" width="75" height="75" border="0"/><img src="thumb14.jpg" width="75" height="75" border="0"/><img src="thumb15.jpg" width="75" height="75" border="0"/><img src="thumb16.jpg" width="75" height="75" border="0"/><img src="thumb17.jpg" width="75" height="75" border="0"/><img src="thumb18.jpg" width="75" height="75" border="0"/><img src="thumb19.jpg" width="75" height="75" border="0"/>
</div>
</div>
</body>
</html>