IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

HTML Discussion :

comment rendre compatible ce script avec firefox ?


Sujet :

HTML

  1. #1
    Futur Membre du Club
    Inscrit en
    Avril 2006
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 16
    Points : 8
    Points
    8
    Par défaut comment rendre compatible ce script avec firefox ?
    bonjours a tous,

    je debute en dhtml, j'ai trouvé un script que j'ai envie d'inclure a mon site, mais je n'arive pas a comprendre comment le rendre compatible avec firefox...

    quelqu'un aurai t il la solution a mon probleme ?

    merci d'avance

  2. #2
    Inscrit
    Profil pro
    Inscrit en
    Septembre 2005
    Messages
    302
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2005
    Messages : 302
    Points : 151
    Points
    151
    Par défaut
    Bonjour,

    Voila copie coller et essaye le

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    <SCRIPT LANGUAGE="JavaScript">
    <!--
    floatX=10;
    floatY=10;
    layerwidth=100;
    layerheight=130;
    halign="center";
    valign="center";
    delayspeed=3;
     
    // This script is copyright (c) Henrik Petersen, NetKontoret
    // Feel free to use this script on your own pages as long as you do not change it.
    // It is illegal to distribute the script as part of a tutorial / script archive.
    // Updated version available at: http://www.echoecho.com/toolfloatinglayer.htm
    // This comment and the 4 lines above may not be removed from the code.
     
    NS6=false;
    IE4=(document.all);
    if (!IE4) {NS6=(document.getElementById);}
    NS4=(document.layers);
     
    function adjust() {
    if ((NS4) || (NS6)) {
    if (lastX==-1 || delayspeed==0)
    {
    lastX=window.pageXOffset + floatX;
    lastY=window.pageYOffset + floatY;
    }
    else
    {
    var dx=Math.abs(window.pageXOffset+floatX-lastX);
    var dy=Math.abs(window.pageYOffset+floatY-lastY);
    var d=Math.sqrt(dx*dx+dy*dy);
    var c=Math.round(d/10);
    if (window.pageXOffset+floatX>lastX) {lastX=lastX+delayspeed+c;}
    if (window.pageXOffset+floatX<lastX) {lastX=lastX-delayspeed-c;}
    if (window.pageYOffset+floatY>lastY) {lastY=lastY+delayspeed+c;}
    if (window.pageYOffset+floatY<lastY) {lastY=lastY-delayspeed-c;}
    }
    if (NS4){
    document.layers['floatlayer'].pageX = lastX;
    document.layers['floatlayer'].pageY = lastY;
    }
    if (NS6){
    document.getElementById('floatlayer').style.left=lastX;
    document.getElementById('floatlayer').style.top=lastY;
    }
    }
    else if (IE4){
    if (lastX==-1 || delayspeed==0)
    {
    lastX=document.body.scrollLeft + floatX;
    lastY=document.body.scrollTop + floatY;
    }
    else
    {
    var dx=Math.abs(document.body.scrollLeft+floatX-lastX);
    var dy=Math.abs(document.body.scrollTop+floatY-lastY);
    var d=Math.sqrt(dx*dx+dy*dy);
    var c=Math.round(d/10);
    if (document.body.scrollLeft+floatX>lastX) {lastX=lastX+delayspeed+c;}
    if (document.body.scrollLeft+floatX<lastX) {lastX=lastX-delayspeed-c;}
    if (document.body.scrollTop+floatY>lastY) {lastY=lastY+delayspeed+c;}
    if (document.body.scrollTop+floatY<lastY) {lastY=lastY-delayspeed-c;}
    }
    document.all['floatlayer'].style.posLeft = lastX;
    document.all['floatlayer'].style.posTop = lastY;
    }
    setTimeout('adjust()',50);
    }
     
    function define()
    {
    if ((NS4) || (NS6))
    {
    if (halign=="left") {floatX=ifloatX};
    if (halign=="right") {floatX=window.innerWidth-ifloatX-layerwidth-20};
    if (halign=="center") {floatX=Math.round((window.innerWidth-20)/2)-Math.round(layerwidth/2)};
    if (valign=="top") {floatY=ifloatY};
    if (valign=="bottom") {floatY=window.innerHeight-ifloatY-layerheight};
    if (valign=="center") {floatY=Math.round((window.innerHeight-20)/2)-Math.round(layerheight/2)};
    }
    if (IE4)
    {
    if (halign=="left") {floatX=ifloatX};
    if (halign=="right") {floatX=document.body.offsetWidth-ifloatX-layerwidth-20}
    if (halign=="center") {floatX=Math.round((document.body.offsetWidth-20)/2)-Math.round(layerwidth/2)}
    if (valign=="top") {floatY=ifloatY};
    if (valign=="bottom") {floatY=document.body.offsetHeight-ifloatY-layerheight}
    if (valign=="center") {floatY=Math.round((document.body.offsetHeight-20)/2)-Math.round(layerheight/2)}
    }
    }
    //-->
    </script>
    <meta name="generator" content="Namo WebEditor">
    <script>
    if (NS4) {document.write('<LAYER NAME="floatlayer" LEFT="'+floatX+'" TOP="'+floatY+'">');}
    if ((IE4) || (NS6)) {document.write('<div id="floatlayer" style="position:absolute; left:'+floatX+'; top:'+floatY+';">');}
    </script>
    <p>***** C’est ici que vous pouvez placer ce que vous voulez *****
    <script>
    if (NS4)
    {
    document.write('</LAYER>');
    }
    if ((IE4) || (NS6))
    {
    document.write('</DIV>');
    }
    ifloatX=floatX;
    ifloatY=floatY;
    define();
    window.onresize=define;
    lastX=-1;
    lastY=-1;
    adjust();
    </script>
    </p>
     
    <-- a effacer les BR -->
     
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    <br><br><br><br><br><br><br>

  3. #3
    Futur Membre du Club
    Inscrit en
    Avril 2006
    Messages
    16
    Détails du profil
    Informations forums :
    Inscription : Avril 2006
    Messages : 16
    Points : 8
    Points
    8
    Par défaut
    merci beaucoup !!!!!!!

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Comment rendre compatible ces <div> IE/Firefox ?
    Par telodo dans le forum Mise en page CSS
    Réponses: 2
    Dernier message: 01/06/2010, 15h12
  2. Comment rendre la position dynamique avec CSS?
    Par m3allem001 dans le forum Mise en page CSS
    Réponses: 3
    Dernier message: 28/01/2010, 15h31
  3. compatibilité de script avec firefox
    Par stefanelle dans le forum Général JavaScript
    Réponses: 9
    Dernier message: 06/05/2009, 11h48
  4. Rendre compatible action script 1 (flash5)
    Par WeDgEMasTeR dans le forum ActionScript 1 & ActionScript 2
    Réponses: 0
    Dernier message: 24/05/2008, 18h32

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo