Voilou, j'explique la situation, j'ai un scroll javascript qui agit sur une suite d'image et de texte placée dans un container qui a une certaine taille. Le scroll s'arrete en bas et en haut de ce container. Un autre script permet une navigation par bouton pour ce déplacer a une position precise de ce container. Jusque la, tout va bien. Pour travailler sur ce script, j'ai travailler sur internet explorer, il fonctionne parfaitement, le scroll s'arrete la ou il faut, et les boutons menent aux bonnes rubrique. Probleme, au moment du test sur mozilla, tout commence par bien fonctionner, jusqu'a l'arret du scroll vers le milieu du container. je teste alors les boutons, les premiers fonctionnent correctement, mais les suivants ne se callent pas aux bonnes images. Je décide alors de modifier la taille de mon container (de lagrandir), le scroll fonctionne alors parfaitement sur mozilla, mais sur IE il descent trop bas. Ainsi, j'ai l'impression qu'il existent deux formats different entre IE et Mozilla. Pourriez vous m'aider SVP, je n'arrive pas a entrevoir de solution. Je balance le code a la suite, merci davance pour votre aide...
MOTEUR DE SCROLL
<!-- début du moteur de scrolling -->
<script language="JavaScript">
<!--
<!--
function MM_reloadPage(init) { //reloads the window if Nav4 resized
if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
// -->
// begin absolutely positioned scrollable area object scripts
function verifyCompatibleBrowser(){
this.ver=navigator.appVersion
this.dom=document.getElementById?1:0
this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
this.ie4=(document.all && !this.dom)?1:0;
this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
this.ns4=(document.layers && !this.dom)?1:0;
this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
return this
}
bw=new verifyCompatibleBrowser()
<!-- réglage de la vitesse du scrolling -->
var speed=50
<!-- fin du réglage de la vitesse du scrolling -->
var loop, timer
function ConstructObject(obj,nest){
nest=(!nest) ? '':'document.'+nest+'.'
this.el=bw.dom?document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):0;
this.css=bw.dom?document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+'document.'+obj):0;
this.scrollHeight=bw.ns4?this.css.document.height:this.el.offsetHeight
this.clipHeight=bw.ns4?this.css.clip.height:this.el.offsetHeight
this.up=MoveAreaUp;this.down=MoveAreaDown;
this.bouge=BougeAncre;
this.MoveArea=MoveArea; this.x; this.y;
this.obj = obj + "Object"
eval(this.obj + "=this")
return this
}
function MoveArea(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function BougeAncre(x,y){
this.x=x;this.y=y
this.css.left=this.x
this.css.top=this.y
}
function MoveAreaDown(move){
//alert(this.y)
if(this.y>-this.scrollHeight+objContainer.clipHeight){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".down("+move+")",speed)
}
}
function MoveAreaUp(move){
if(this.y<0){
this.MoveArea(0,this.y-move)
if(loop) setTimeout(this.obj+".up("+move+")",speed)
}
}
function PerformScroll(speed){
if(initialised){
loop=true;
if(speed>0) objScroller.down(speed)
else objScroller.up(speed)
}
}
function BougeArea(myY){
objScroller.bouge(0,myY)
}
function CeaseScroll(){
loop=false
if(timer) clearTimeout(timer)
}
var initialised;
function InitialiseScrollableArea(){
objContainer=new ConstructObject('BackgroundContainer')
objScroller=new ConstructObject('BackgroundContent','BackgroundContainer')
objScroller.MoveArea(0,0)
objContainer.css.visibility='visible'
initialised=true;
}
// end absolutely positioned scrollable area object scripts
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<style type="text/css">
#ScrollUpControl{
position:absolute;
width:16px;
left:705px;
top:123px;
z-index:2;
height: 16px;
}
#ScrollDownControl{
position:absolute;
width:16px;
left:705px;
top:392px;
z-index:3;
height: 16px;
}
#BackgroundContainer{
position:absolute;
width:418px;
height:284px;
overflow:hidden;
top:124px;
left:280px;
clip:rect(0,418,284,0);
visibility: visible;
}
#BackgroundContent{
position:absolute;
top:22px;
left:0px;
width:426px;
height:2893px;
}
</style>
<link href="../../style/text.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
a:link {
color: #000000;
}
a:visited {
color: #000000;
}
a:hover {
color: #000000;
}
a:active {
color: #000000;
}
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
-->
</style></head>
BOUTONS DE POSITIONNEMENT DU CONTAINER
<map name="navigation" >
<area shape="rect" coords="18,15,60,31" href="javascript:;" onClick="BougeArea(0)">
<area shape="rect" coords="18,30,63,46" href="javascript:;" onClick="BougeArea(-235)">
<area shape="rect" coords="18,45,65,60" href="javascript:;" onClick="BougeArea(-470)">
<area shape="rect" coords="18,59,73,75" href="javascript:;" onClick="BougeArea(-705)">
<area shape="rect" coords="18,74,114,90" href="javascript:;" onClick="BougeArea(-940)">
<area shape="rect" coords="18,89,77,104" href="javascript:;" onClick="BougeArea(-1175)">
<area shape="rect" coords="18,103,65,122" href="javascript:;" onClick="BougeArea(-1410)">
<area shape="rect" coords="18,121,73,136" href="javascript:;" onClick="BougeArea(-1645)">
<area shape="rect" coords="18,134,57,150" href="javascript:;" onClick="BougeArea(-1880)">
<area shape="rect" coords="18,149,70,165" href="javascript:;" onClick="BougeArea(-2188)">
<area shape="rect" coords="18,164,100,180" href="javascript:;" onClick="BougeArea(-2423)">
<area shape="rect" coords="18,179,70,195" href="javascript:;" onClick="BougeArea(-2600)">
</map>