Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<style type="text/css">
/*<![CDATA[*/
.wrapper {
position:absolute;overflow:hidden;left:0px;top:20px;width:100%;height:365px;
}
.scroll-pane {
position:absolute;left:0px;top:0px;width:6100px;height:355px;
}
.wrapper IMG{
float:left;border-Width:0px;
}
.bar {
position:absolute;left:0px;top:355px;width:100%;height:10px;
}
.slide {
position:absolute;left:0px;top:0px;width:200px;height:10px;background-Color:#FFCC66;
}
/*]]>*/
</style>
</head>
<body>
<div id="gallerywrap" class="wrapper" >
<div class="scroll-pane">
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0454.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0462.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0466.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0471.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0475.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0480.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0454.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0462.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0466.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0471.jpg" /></a>
<a href="single-image.html"><img src="http://remotec.bplaced.net/jo/images/gallery1/_MG_0475.jpg" /></a>
</div> <!--#gallerywrap2 -->
<div class="bar">
<div class="slide"></div>
</div>
</div> <!--#gallerywrap -->
<script type="text/javascript">
/*<![CDATA[*/
// Gallery Wrap (15-July-2012)
// by Vic Phillips - http://www.vicsjavascripts.org.uk/
function zxcGalleryWrap(o){
var p=document.getElementById(o.ID),divs=p.getElementsByTagName('DIV'),div=divs[0],bar=divs[1],clds=div.childNodes,ary=[],a,img,z0=0;
for (;z0<clds.length;z0++){
if (clds[z0].nodeType==1){
a=[clds[z0]]
img=clds[z0].nodeName.toUpperCase()=='IMG'||clds[z0].getElementsByTagName('IMG')[0];
if (img){
a[1]=new Image();
a[1].src=img.src;
}
ary.push(a);
}
}
this.p=p;
this.div=div;
this.ary=ary;
this.bar=bar;
this.slide=bar.getElementsByTagName('DIV')[0];
this.drag=false;
this.os=typeof(o.Offset)=='number'?o.Offset:0;
this.xy=this.os;
this.slide.style.left=this.xy+'px';
this.div.style.left=this.xy+'px';
this.resize();
this.load();
}
zxcGalleryWrap.prototype={
load:function(){
for (var oop=this,ary=oop.ary,z0=0;z0<ary.length;z0++){
if (ary[z0][1]&&ary[z0][1].width<40){
this.to=setTimeout(function(){ oop.load(); },100);
return;
}
}
this.init();
},
init:function(){
var ary=this.ary,lst=ary[ary.length-1][0];
this.lst=lst.offsetLeft+lst.offsetWidth;
this.addevt(this.slide,'mousedown','down');
this.addevt(document,'mousemove','move');
this.addevt(document,'mouseup','up');
this.addevt(window,'resize','resize');
},
resize:function(){
this.xy=this.os;
this.slide.style.left=this.xy+'px';
this.div.style.left=this.xy+'px';
},
down:function(e){
document.onselectstart=function(event){ window.event.returnValue=false; }
this.lstxy=[e.clientX,e.clientY][0];
this.drag=this.slide;
if (!window.event) e.preventDefault();
return this.rtn(e);
},
move:function(e){
if (this.drag){
var o=this,mse=[e.clientX,e.clientY][0],max=o.bar.offsetWidth-o.slide.offsetWidth,xy=Math.min(Math.max(o.xy+=mse-o.lstxy,o.os),max);
o.slide.style.left=xy+'px';
o.div.style.left=(-o.lst+o.p.offsetWidth-o.os)*(xy-o.os+.1)/(max-o.os)+o.os+'px';
o.xy=xy
o.lstxy=mse;
return this.rtn(e);
}
},
up:function(e){
document.onselectstart=null;
this.drag=false;
},
rtn:function(e){
if(e.stopPropagation){
e.stopPropagation();
}
if (!window.event){
e.preventDefault();
}
e.cancelBubble=true;
e.cancel=true;
e.returnValue=false;
return false;
},
addevt:function(o,t,f,p){
var oop=this;
if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](e,p);}, false);
else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](e,p); });
}
}
new zxcGalleryWrap({
ID:'gallerywrap',
Offset:200
});
/*]]>*/
</script>
</body>
</html>
Bookmarks