PDA

View Full Version : incompatibilities



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 ? :)

jscheuer1
11-24-2005, 09:05 AM
This is a stock response:

.

Aside from the tutorial above, which usually is the solution when the problem is two different scripts, you may need to consult:

http://www.howtocreate.co.uk/tutorials/index.php?tut=0&part=0&TOshow=allshow#refcon

Which explains how two scripts on the same page may not use the same set of variable names, id names, function names, etc. This is especially important if the problem is two copies of the same script on a page but, can come into play with two different scripts when the first step won't fix it.

One other approach that works in both situations, if adaptable to one (or more) of the scripts, is to put one script in a borderless iframe. It will look like it is on the same page but, since it really is on a separate page, conflicts are no longer an issue.

Maxime
11-24-2005, 09:17 AM
understood...
Thanks for the link. I am going on my investigations.