Maxime
11-23-2005, 11:40 AM
Hi all,
I can not make the Tab Content Script (http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm) works with the CMotion Image Gallery ("http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm) or with this script (which does not come from DD :rolleyes: ) :
<!--
//The speed of the timeout between each scroll.
timSpeed=50
//The height of the container (change this when it scrolls to much or to little)
contHeight=507
function makeScrollObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.' ;
if (n6){
this.css=document.getElementById(obj).style ;
} else if (n){
this.css=eval(nest+'document.'+obj) ;
} else if (ie){
this.css=eval('document.all.'+obj+'.style') ;
}
if (n6){
this.scrollHeight=document.getElementById(obj).offsetHeight ;
} else if (n){
this.scrollHeight=this.css.document.height ;
} else if (ie){
this.scrollHeight=eval('document.all.'+obj+'.offsetHeight') ;
}
this.top=b_gettop
return this
}
//Getting the top for the top method
function b_gettop(){
if (n6){
var gleft=parseInt(this.css.top) ;
} else if (n){
var gleft=eval(this.css.top) ;
} else if (ie){
var gleft=eval(this.css.pixelTop) ;
}
return gleft;
}
//Variables
var hasInit = false ;
var scrollTim;
var active=0;
function scroll(speed){
if (hasInit){
clearTimeout(scrollTim)
way=speed>0?1:0
if((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)){
oScroll[active].css.top=oScroll[active].top()+speed
scrollTim=setTimeout("scroll("+speed+")",timSpeed)
}
}
}
//Clears the timeout so the scroll stops, this is called onmouseout.
function noScroll(){
clearTimeout(scrollTim)
}
function scrollInit(){
oScroll=new Array()
oScroll[0]=new makeScrollObj('content','Pcontent')
oScroll[0].css.visibility='visible'
hasInit = true ;
}
/*********************************************************************************
Executes the scrollInit function on pageload.
*********************************************************************************/
onload=scrollInit;
//-->
I have looked for a solution by myself but it seems I was a bit too presumptuous... :p
Can anyone help me, please ? :)
I can not make the Tab Content Script (http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm) works with the CMotion Image Gallery ("http://www.dynamicdrive.com/dynamicindex4/cmotiongallery.htm) or with this script (which does not come from DD :rolleyes: ) :
<!--
//The speed of the timeout between each scroll.
timSpeed=50
//The height of the container (change this when it scrolls to much or to little)
contHeight=507
function makeScrollObj(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.' ;
if (n6){
this.css=document.getElementById(obj).style ;
} else if (n){
this.css=eval(nest+'document.'+obj) ;
} else if (ie){
this.css=eval('document.all.'+obj+'.style') ;
}
if (n6){
this.scrollHeight=document.getElementById(obj).offsetHeight ;
} else if (n){
this.scrollHeight=this.css.document.height ;
} else if (ie){
this.scrollHeight=eval('document.all.'+obj+'.offsetHeight') ;
}
this.top=b_gettop
return this
}
//Getting the top for the top method
function b_gettop(){
if (n6){
var gleft=parseInt(this.css.top) ;
} else if (n){
var gleft=eval(this.css.top) ;
} else if (ie){
var gleft=eval(this.css.pixelTop) ;
}
return gleft;
}
//Variables
var hasInit = false ;
var scrollTim;
var active=0;
function scroll(speed){
if (hasInit){
clearTimeout(scrollTim)
way=speed>0?1:0
if((!way && oScroll[active].top()>-oScroll[active].scrollHeight+contHeight) || (oScroll[active].top()<0 && way)){
oScroll[active].css.top=oScroll[active].top()+speed
scrollTim=setTimeout("scroll("+speed+")",timSpeed)
}
}
}
//Clears the timeout so the scroll stops, this is called onmouseout.
function noScroll(){
clearTimeout(scrollTim)
}
function scrollInit(){
oScroll=new Array()
oScroll[0]=new makeScrollObj('content','Pcontent')
oScroll[0].css.visibility='visible'
hasInit = true ;
}
/*********************************************************************************
Executes the scrollInit function on pageload.
*********************************************************************************/
onload=scrollInit;
//-->
I have looked for a solution by myself but it seems I was a bit too presumptuous... :p
Can anyone help me, please ? :)