Log in

View Full Version : News content slideshow?



paddyt007
09-16-2010, 06:07 PM
Hello

I'm looking for a script similar to the one found on this site. http://www.uka.org.uk/
As you can see it automatically moves to the next news article every 8 or so seconds. The Image changes.
However when you mouseover the menu on the right it brings up the image related to that news article.

I've been searching for a while or something like this, there's similar scripts but usually doesn't incorporate the side menu.

Any help would be appreciated.

vwphillips
09-17-2010, 10:52 AM
<!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[*/
.ss {
position:relative;width:865px;height:295px;border:solid black 1px;
}
#images {
position:relative;width:660px;height:295px;border:solid black 0px;
}
#images IMG{
position:absolute;left:0px;height:0px;width:660px;height:295px;
}

#items {
position:absolute;left:665px;top:0px;width:200px;
}

.item {
position:relative;width:200px;height:35px;background-Color:#33CCCC;margin-bottom:2px;
}

.active {
background-Color:#CCFFFF;
}

/*]]>*/
</style></head>

<body>
<div class="ss" >
<div id="images" >
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=59773&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58656&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=39942&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=51599&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41574&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58657&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41605&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41302&type=full&servicetype=Inline&customSizeId=0" />
</div>
<div id="items" >
<div class="item" >Item 1</div>
<div class="item" >Item 2</div>
<div class="item" >Item 3</div>
<div class="item" >Item 4</div>
<div class="item" >Item 5</div>
<div class="item" >Item 6</div>
<div class="item" >Item 7</div>
<div class="item" >Item 8</div>
</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/

function SS(o){
var obj=document.getElementById(o.SSID);
if (obj){
this.parent=obj.parentNode;
var frames=this.bycls(o.SSClassName,obj);
this.frames=[];
for (var z0=0;z0<frames.length;z0++){
frames[z0].style.zIndex=z0>0?'0':'1';
this.frames[z0]=frames[z0];
}
obj=document.getElementById(o.ItemID);
if (obj){
this.off=o.ItemClassName;
this.on=this.off+' '+(o.ItemActiveClassName?' '+o.ItemActiveClassName:'');
this.items=this.bycls(this.off,obj);
for (var z1=0;z1<this.items.length;z1++){
if (this.frames[z1]){
this.addevt(this.items[z1],'mouseover','itemover',z1);
this.addevt(this.items[z1],'mouseout','itemout',z1);
}
}
}
this.addevt(this.parent,'mouseover','pause');
this.addevt(this.parent,'mouseout','mseout');
this.hold=o.Duration||5000;
this.cnt=0;
this.GoTo(this.cnt);
this.Auto();
}
}

SS.prototype={

Auto:function(){
var oop=this;
clearTimeout(this.to);
this.to=setTimeout(function(){ oop.GoTo(oop.cnt+1); oop.Auto(); },this.hold);
},

GoTo:function(nu){
clearTimeout(this.to);
if (this.items[this.cnt]){
this.items[this.cnt].className=this.off;
}
this.frames[this.cnt].style.zIndex='0';
this.cnt=nu<this.frames.length?nu:0;
if (this.items[this.cnt]){
this.items[this.cnt].className=this.on;
}
this.frames[this.cnt].style.zIndex='1';
},

addevt:function(o,t,f,p){
var oop=this;
if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](p,e);}, false);
else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](p,e); });
},

mseout:function(p,e){
var e=window.event?window.event:arguments.callee.caller?arguments.callee.caller.arguments[0]:false;
if (e&&e.type=='mouseout'){
var obj=(e.relatedTarget)?e.relatedTarget:e.toElement;
if (!obj){
return;
}
while (obj.parentNode){
if (obj==this.parent){
return false;
}
obj=obj.parentNode;
}
}
this.Auto();
},

pause:function(){
clearTimeout(this.to);
},

itemover:function(nu){
this.items[nu].className=this.on;
this.GoTo(nu);
},

itemout:function(nu){
this.items[nu].className=this.off;
},

bycls:function(nme,el){
for (reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)) ary.push(els[z0]);
}
return ary;
}


}

new SS({
SSID:'images',
SSClassName:'img',
Duration:2000,
ItemID:'items',
ItemClassName:'item',
ItemActiveClassName:'active'
});
/*]]>*/
</script>
</body>

</html>

vwphillips
09-17-2010, 10:55 AM
or


<!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[*/
.ss {
position:relative;width:865px;height:295px;border:solid black 1px;
}
#images {
position:relative;width:660px;height:295px;border:solid black 0px;
}
#images IMG{
position:absolute;left:0px;height:0px;width:660px;height:295px;
}

#items {
position:absolute;left:665px;top:0px;width:200px;
}

.item {
position:relative;width:200px;height:35px;background-Color:#33CCCC;margin-bottom:2px;
}

.active {
background-Color:#CCFFFF;
}

/*]]>*/
</style>
<script type="text/javascript">
// Animate (11-January-2010)
// by Vic Phillips http://www.vicsjavascripts.org.uk

// To progressively change the Left, Top, Width, Height or Opacity of an element over a specified period of time.
// With the ability to scale the effect time on specified minimum/maximum values
// and with three types of progression 'sin' and 'cos' and liner.

// **** Application Notes

// **** see http://www.vicsjavascripts.org.uk/Animate/Animate.htm

// **** Functional Code(1.52K) - NO NEED to Change

function zxcAnimate(mde,obj,srt){
this.to=null;
this.obj=typeof(obj)=='object'?obj:document.getElementById(obj);
this.mde=mde.replace(/\W/g,'');
this.data=[srt||0];
return this;
}

zxcAnimate.prototype={

animate:function(srt,fin,ms,scale,c){
clearTimeout(this.to);
this.time=ms||this.time||0;
this.neg=srt<0||fin<0;
this.data=[srt,srt,fin];
this.mS=this.time*(!scale?1:Math.abs((fin-srt)/(scale[1]-scale[0])));
this.c=typeof(c)=='string'?c.charAt(0).toLowerCase():this.c?this.c:'';
this.inc=Math.PI/(2*this.mS);
this.srttime=new Date().getTime();
this.cng();
},

cng:function(){
var oop=this,ms=new Date().getTime()-this.srttime;
this.data[0]=(this.c=='s')?(this.data[2]-this.data[1])*Math.sin(this.inc*ms)+this.data[1]:(this.c=='c')?this.data[2]-(this.data[2]-this.data[1])*Math.cos(this.inc*ms):(this.data[2]-this.data[1])/this.mS*ms+this.data[1];
this.apply();
if (ms<this.mS) this.to=setTimeout(function(){oop.cng()},10);
else {
this.data[0]=this.data[2];
this.apply();
if (this.Complete) this.Complete(this);
}
},

apply:function(){
if (isFinite(this.data[0])){
if (this.data[0]<0&&!this.neg) this.data[0]=0;
if (this.mde!='opacity') this.obj.style[this.mde]=Math.floor(this.data[0])+'px';
else zxcOpacity(this.obj,this.data[0]);
}
}

}

function zxcOpacity(obj,opc){
if (opc<0||opc>100) return;
obj.style.filter='alpha(opacity='+opc+')';
obj.style.opacity=obj.style.MozOpacity=obj.style.WebkitOpacity=obj.style.KhtmlOpacity=opc/100-.001;
}


</script>


</head>

<body>
<div class="ss" >
<div id="images" >
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=59773&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58656&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=39942&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=51599&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41574&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58657&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41605&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41302&type=full&servicetype=Inline&customSizeId=0" />
</div>
<div id="items" >
<div class="item" >Item 1</div>
<div class="item" >Item 2</div>
<div class="item" >Item 3</div>
<div class="item" >Item 4</div>
<div class="item" >Item 5</div>
<div class="item" >Item 6</div>
<div class="item" >Item 7</div>
<div class="item" >Item 8</div>
</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/

function SS(o){
var obj=document.getElementById(o.SSID);
if (obj){
this.parent=obj.parentNode;
var frames=this.bycls(o.SSClassName,obj);
this.frames=[];
for (var z0=0;z0<frames.length;z0++){
frames[z0].style.zIndex=z0>0?'0':'1';
this.frames[z0]=new zxcAnimate('opacity',frames[z0],z0>0?0:100);
zxcOpacity(frames[z0],z0>0?0:100);
}
obj=document.getElementById(o.ItemID);
if (obj){
this.off=o.ItemClassName;
this.on=this.off+' '+(o.ItemActiveClassName?' '+o.ItemActiveClassName:'');
this.items=this.bycls(this.off,obj);
for (var z1=0;z1<this.items.length;z1++){
if (this.frames[z1]){
this.addevt(this.items[z1],'mouseover','itemover',z1);
this.addevt(this.items[z1],'mouseout','itemout',z1);
}
}
}
this.addevt(this.parent,'mouseover','pause');
this.addevt(this.parent,'mouseout','mseout');
this.ms=o.Duration||1000;
this.hold=o.Hold||this.ms*4;
this.cnt=0;
this.GoTo(this.cnt);
this.Auto();
}
}

SS.prototype={

Auto:function(){
var oop=this;
clearTimeout(this.to);
this.to=setTimeout(function(){ oop.GoTo(oop.cnt+1); oop.Auto(); },this.hold+this.ms);
},

GoTo:function(nu){
clearTimeout(this.to);
if (this.items[this.cnt]){
this.items[this.cnt].className=this.off;
}
this.frames[this.cnt].obj.style.zIndex='0';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],0,this.ms,[0,100]);
this.cnt=nu<this.frames.length?nu:0;
if (this.items[this.cnt]){
this.items[this.cnt].className=this.on;
}
this.frames[this.cnt].obj.style.zIndex='1';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],100,this.ms,[0,100]);
},

addevt:function(o,t,f,p){
var oop=this;
if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](p,e);}, false);
else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](p,e); });
},

mseout:function(p,e){
var e=window.event?window.event:arguments.callee.caller?arguments.callee.caller.arguments[0]:false;
if (e&&e.type=='mouseout'){
var obj=(e.relatedTarget)?e.relatedTarget:e.toElement;
if (!obj){
return;
}
while (obj.parentNode){
if (obj==this.parent){
return false;
}
obj=obj.parentNode;
}
}
this.Auto();
},

pause:function(){
clearTimeout(this.to);
},

itemover:function(nu){
this.items[nu].className=this.on;
this.GoTo(nu);
},

itemout:function(nu){
this.items[nu].className=this.off;
},

bycls:function(nme,el){
for (reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)) ary.push(els[z0]);
}
return ary;
}


}

new SS({
SSID:'images',
SSClassName:'img',
Hold:2000,
Duration:1000,
ItemID:'items',
ItemClassName:'item',
ItemActiveClassName:'active'
});
/*]]>*/
</script>
</body>

</html>

paddyt007
09-17-2010, 11:28 AM
or


<!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[*/
.ss {
position:relative;width:865px;height:295px;border:solid black 1px;
}
#images {
position:relative;width:660px;height:295px;border:solid black 0px;
}
#images IMG{
position:absolute;left:0px;height:0px;width:660px;height:295px;
}

#items {
position:absolute;left:665px;top:0px;width:200px;
}

.item {
position:relative;width:200px;height:35px;background-Color:#33CCCC;margin-bottom:2px;
}

.active {
background-Color:#CCFFFF;
}

/*]]>*/
</style>
<script type="text/javascript">
// Animate (11-January-2010)
// by Vic Phillips http://www.vicsjavascripts.org.uk

// To progressively change the Left, Top, Width, Height or Opacity of an element over a specified period of time.
// With the ability to scale the effect time on specified minimum/maximum values
// and with three types of progression 'sin' and 'cos' and liner.

// **** Application Notes

// **** see http://www.vicsjavascripts.org.uk/Animate/Animate.htm

// **** Functional Code(1.52K) - NO NEED to Change

function zxcAnimate(mde,obj,srt){
this.to=null;
this.obj=typeof(obj)=='object'?obj:document.getElementById(obj);
this.mde=mde.replace(/\W/g,'');
this.data=[srt||0];
return this;
}

zxcAnimate.prototype={

animate:function(srt,fin,ms,scale,c){
clearTimeout(this.to);
this.time=ms||this.time||0;
this.neg=srt<0||fin<0;
this.data=[srt,srt,fin];
this.mS=this.time*(!scale?1:Math.abs((fin-srt)/(scale[1]-scale[0])));
this.c=typeof(c)=='string'?c.charAt(0).toLowerCase():this.c?this.c:'';
this.inc=Math.PI/(2*this.mS);
this.srttime=new Date().getTime();
this.cng();
},

cng:function(){
var oop=this,ms=new Date().getTime()-this.srttime;
this.data[0]=(this.c=='s')?(this.data[2]-this.data[1])*Math.sin(this.inc*ms)+this.data[1]:(this.c=='c')?this.data[2]-(this.data[2]-this.data[1])*Math.cos(this.inc*ms):(this.data[2]-this.data[1])/this.mS*ms+this.data[1];
this.apply();
if (ms<this.mS) this.to=setTimeout(function(){oop.cng()},10);
else {
this.data[0]=this.data[2];
this.apply();
if (this.Complete) this.Complete(this);
}
},

apply:function(){
if (isFinite(this.data[0])){
if (this.data[0]<0&&!this.neg) this.data[0]=0;
if (this.mde!='opacity') this.obj.style[this.mde]=Math.floor(this.data[0])+'px';
else zxcOpacity(this.obj,this.data[0]);
}
}

}

function zxcOpacity(obj,opc){
if (opc<0||opc>100) return;
obj.style.filter='alpha(opacity='+opc+')';
obj.style.opacity=obj.style.MozOpacity=obj.style.WebkitOpacity=obj.style.KhtmlOpacity=opc/100-.001;
}


</script>


</head>

<body>
<div class="ss" >
<div id="images" >
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=59773&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58656&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=39942&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=51599&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41574&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58657&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41605&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41302&type=full&servicetype=Inline&customSizeId=0" />
</div>
<div id="items" >
<div class="item" >Item 1</div>
<div class="item" >Item 2</div>
<div class="item" >Item 3</div>
<div class="item" >Item 4</div>
<div class="item" >Item 5</div>
<div class="item" >Item 6</div>
<div class="item" >Item 7</div>
<div class="item" >Item 8</div>
</div>
</div>

<script type="text/javascript">
/*<![CDATA[*/

function SS(o){
var obj=document.getElementById(o.SSID);
if (obj){
this.parent=obj.parentNode;
var frames=this.bycls(o.SSClassName,obj);
this.frames=[];
for (var z0=0;z0<frames.length;z0++){
frames[z0].style.zIndex=z0>0?'0':'1';
this.frames[z0]=new zxcAnimate('opacity',frames[z0],z0>0?0:100);
zxcOpacity(frames[z0],z0>0?0:100);
}
obj=document.getElementById(o.ItemID);
if (obj){
this.off=o.ItemClassName;
this.on=this.off+' '+(o.ItemActiveClassName?' '+o.ItemActiveClassName:'');
this.items=this.bycls(this.off,obj);
for (var z1=0;z1<this.items.length;z1++){
if (this.frames[z1]){
this.addevt(this.items[z1],'mouseover','itemover',z1);
this.addevt(this.items[z1],'mouseout','itemout',z1);
}
}
}
this.addevt(this.parent,'mouseover','pause');
this.addevt(this.parent,'mouseout','mseout');
this.ms=o.Duration||1000;
this.hold=o.Hold||this.ms*4;
this.cnt=0;
this.GoTo(this.cnt);
this.Auto();
}
}

SS.prototype={

Auto:function(){
var oop=this;
clearTimeout(this.to);
this.to=setTimeout(function(){ oop.GoTo(oop.cnt+1); oop.Auto(); },this.hold+this.ms);
},

GoTo:function(nu){
clearTimeout(this.to);
if (this.items[this.cnt]){
this.items[this.cnt].className=this.off;
}
this.frames[this.cnt].obj.style.zIndex='0';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],0,this.ms,[0,100]);
this.cnt=nu<this.frames.length?nu:0;
if (this.items[this.cnt]){
this.items[this.cnt].className=this.on;
}
this.frames[this.cnt].obj.style.zIndex='1';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],100,this.ms,[0,100]);
},

addevt:function(o,t,f,p){
var oop=this;
if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](p,e);}, false);
else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](p,e); });
},

mseout:function(p,e){
var e=window.event?window.event:arguments.callee.caller?arguments.callee.caller.arguments[0]:false;
if (e&&e.type=='mouseout'){
var obj=(e.relatedTarget)?e.relatedTarget:e.toElement;
if (!obj){
return;
}
while (obj.parentNode){
if (obj==this.parent){
return false;
}
obj=obj.parentNode;
}
}
this.Auto();
},

pause:function(){
clearTimeout(this.to);
},

itemover:function(nu){
this.items[nu].className=this.on;
this.GoTo(nu);
},

itemout:function(nu){
this.items[nu].className=this.off;
},

bycls:function(nme,el){
for (reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)) ary.push(els[z0]);
}
return ary;
}


}

new SS({
SSID:'images',
SSClassName:'img',
Hold:2000,
Duration:1000,
ItemID:'items',
ItemClassName:'item',
ItemActiveClassName:'active'
});
/*]]>*/
</script>
</body>

</html>



Ah thank you very much vwphillips . I really like the faded effect in the second one.

Thanks!

azoomer
09-17-2010, 02:42 PM
Very nice, Vic. Thanks a lot

Matthias70
09-21-2010, 09:21 PM
Hi Vic,
can you please give an example who to make the links work in the above code?
I don't know how to make the links (item 1, item2 ...) clickable...

Thanks
Matthias

vwphillips
09-22-2010, 07:42 AM
<!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[*/
.ss {
position:relative;width:865px;height:295px;border:solid black 1px;
}
#images {
position:relative;width:660px;height:295px;border:solid black 0px;
}
#images IMG{
position:absolute;left:0px;height:0px;width:660px;height:295px;
}

#items {
position:absolute;left:665px;top:0px;width:200px;
}

.item {
position:relative;width:200px;height:35px;background-Color:#33CCCC;margin-bottom:2px;
}

.active {
background-Color:#CCFFFF;
}

/*]]>*/
</style>
<script type="text/javascript">
// Animate (11-January-2010)
// by Vic Phillips http://www.vicsjavascripts.org.uk

// To progressively change the Left, Top, Width, Height or Opacity of an element over a specified period of time.
// With the ability to scale the effect time on specified minimum/maximum values
// and with three types of progression 'sin' and 'cos' and liner.

// **** Application Notes

// **** see http://www.vicsjavascripts.org.uk/Animate/Animate.htm

// **** Functional Code(1.52K) - NO NEED to Change

function zxcAnimate(mde,obj,srt){
this.to=null;
this.obj=typeof(obj)=='object'?obj:document.getElementById(obj);
this.mde=mde.replace(/\W/g,'');
this.data=[srt||0];
return this;
}

zxcAnimate.prototype={

animate:function(srt,fin,ms,scale,c){
clearTimeout(this.to);
this.time=ms||this.time||0;
this.neg=srt<0||fin<0;
this.data=[srt,srt,fin];
this.mS=this.time*(!scale?1:Math.abs((fin-srt)/(scale[1]-scale[0])));
this.c=typeof(c)=='string'?c.charAt(0).toLowerCase():this.c?this.c:'';
this.inc=Math.PI/(2*this.mS);
this.srttime=new Date().getTime();
this.cng();
},

cng:function(){
var oop=this,ms=new Date().getTime()-this.srttime;
this.data[0]=(this.c=='s')?(this.data[2]-this.data[1])*Math.sin(this.inc*ms)+this.data[1]:(this.c=='c')?this.data[2]-(this.data[2]-this.data[1])*Math.cos(this.inc*ms):(this.data[2]-this.data[1])/this.mS*ms+this.data[1];
this.apply();
if (ms<this.mS) this.to=setTimeout(function(){oop.cng()},10);
else {
this.data[0]=this.data[2];
this.apply();
if (this.Complete) this.Complete(this);
}
},

apply:function(){
if (isFinite(this.data[0])){
if (this.data[0]<0&&!this.neg) this.data[0]=0;
if (this.mde!='opacity') this.obj.style[this.mde]=Math.floor(this.data[0])+'px';
else zxcOpacity(this.obj,this.data[0]);
}
}

}

function zxcOpacity(obj,opc){
if (opc<0||opc>100) return;
obj.style.filter='alpha(opacity='+opc+')';
obj.style.opacity=obj.style.MozOpacity=obj.style.WebkitOpacity=obj.style.KhtmlOpacity=opc/100-.001;
}


</script>


</head>

<body>
<div class="ss" >
<div id="images" >
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=59773&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58656&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=39942&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=51599&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41574&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=58657&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41605&type=full&servicetype=Inline&customSizeId=0" />
<img class="img" src="http://www.uka.org.uk/EasySiteWeb/getresource.axd?AssetID=41302&type=full&servicetype=Inline&customSizeId=0" />
</div>
<div id="items" >
<div class="item" >Item 1</div>
<div class="item" >Item 2</div>
<div class="item" >Item 3</div>
<div class="item" >Item 4</div>
<div class="item" >Item 5</div>
<div class="item" >Item 6</div>
<div class="item" >Item 7</div>
<div class="item" >Item 8</div>
</div>
</div>
<a href="#" onclick="s1.GoTo(0); return false;" >GoTo(0);</a>
<a href="#" onclick="s1.GoTo(1); return false;" >GoTo(1);</a>
<a href="#" onclick="s1.GoTo(2); return false;" >GoTo(2);</a>
<script type="text/javascript">
/*<![CDATA[*/

function SS(o){
var obj=document.getElementById(o.SSID);
if (obj){
this.parent=obj.parentNode;
var frames=this.bycls(o.SSClassName,obj);
this.frames=[];
for (var z0=0;z0<frames.length;z0++){
frames[z0].style.zIndex=z0>0?'0':'1';
this.frames[z0]=new zxcAnimate('opacity',frames[z0],z0>0?0:100);
zxcOpacity(frames[z0],z0>0?0:100);
}
obj=document.getElementById(o.ItemID);
if (obj){
this.off=o.ItemClassName;
this.on=this.off+' '+(o.ItemActiveClassName?' '+o.ItemActiveClassName:'');
this.items=this.bycls(this.off,obj);
for (var z1=0;z1<this.items.length;z1++){
if (this.frames[z1]){
this.addevt(this.items[z1],'mouseover','itemover',z1);
this.addevt(this.items[z1],'mouseout','itemout',z1);
}
}
}
this.addevt(this.parent,'mouseover','pause');
this.addevt(this.parent,'mouseout','mseout');
this.ms=o.Duration||1000;
this.hold=o.Hold||this.ms*4;
this.cnt=0;
this.GoTo(this.cnt);
this.Auto();
}
}

SS.prototype={

Auto:function(){
var oop=this;
clearTimeout(this.to);
this.to=setTimeout(function(){ oop.GoTo(oop.cnt+1); oop.Auto(); },this.hold+this.ms);
},

GoTo:function(nu){
clearTimeout(this.to);
nu=nu<this.frames.length?nu:0;
if (this.frames[nu]){
if (this.items[this.cnt]){
this.items[this.cnt].className=this.off;
}
this.frames[this.cnt].obj.style.zIndex='0';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],0,this.ms,[0,100]);
this.cnt=nu;
if (this.items[this.cnt]){
this.items[this.cnt].className=this.on;
}
this.frames[this.cnt].obj.style.zIndex='1';
this.frames[this.cnt].animate(this.frames[this.cnt].data[0],100,this.ms,[0,100]);
}
},

addevt:function(o,t,f,p){
var oop=this;
if (o.addEventListener) o.addEventListener(t,function(e){ return oop[f](p,e);}, false);
else if (o.attachEvent) o.attachEvent('on'+t,function(e){ return oop[f](p,e); });
},

mseout:function(p,e){
var e=window.event?window.event:arguments.callee.caller?arguments.callee.caller.arguments[0]:false;
if (e&&e.type=='mouseout'){
var obj=(e.relatedTarget)?e.relatedTarget:e.toElement;
if (!obj){
return;
}
while (obj.parentNode){
if (obj==this.parent){
return false;
}
obj=obj.parentNode;
}
}
this.Auto();
},

pause:function(){
clearTimeout(this.to);
},

itemover:function(nu){
this.items[nu].className=this.on;
this.GoTo(nu);
},

itemout:function(nu){
this.items[nu].className=this.off;
},

bycls:function(nme,el){
for (reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName('*'),ary=[],z0=0; z0<els.length;z0++){
if(reg.test(els[z0].className)) ary.push(els[z0]);
}
return ary;
}


}

s1=new SS({
SSID:'images',
SSClassName:'img',
Hold:2000,
Duration:1000,
ItemID:'items',
ItemClassName:'item',
ItemActiveClassName:'active'
});
/*]]>*/
</script>
</body>

</html>

Matthias70
09-22-2010, 07:01 PM
Hi Vic,
this code still does not work. Your extension just shows three links below the images, but does not make item 1, item 2, item 3 on the right side of the images clickable...

Matthias

azoomer
09-22-2010, 08:33 PM
Did you try the simple solution ?

<div class="item" ><a href="http://www.dynamicdrive.com">Item 1</a></div>

( sorry if I haven't understood your question correctly)

Matthias70
09-22-2010, 08:36 PM
Did you try the simple solution ?

<div class="item" ><a href="http://www.dynamicdrive.com">Item 1</a></div>

( sorry if I haven't understood your question correctly)

Yes, certainly I tried the simple solution, but it does not work...

Matthias70
09-22-2010, 08:40 PM
Ups, now the simple solution is working. Maybe I had a typo in the code...
I will test it...