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

EDI, CMS, Outils, Scripts et API PHP Discussion :

Besoin d'aide pour adapter un script


Sujet :

EDI, CMS, Outils, Scripts et API PHP

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Mai 2008
    Messages
    2
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Mai 2008
    Messages : 2
    Par défaut Besoin d'aide pour adapter un script
    Salut a tous voila j'ai un site d'upload d'image et depuis longtemps je cherche un script pour afficher une image avec des dimention reduite tout en gardent l'image original et quand on clique dessu elle aparait dans ca taille réel.

    donc j'ai réussi a avoire un script pour ca... mais le probleme c'est qu'il affiche directement l'image dans ca taille réel !

    je done le code du script jespere que vous pourez m'aider...

    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
     
    <html>
     
    <head>
    <title>Sans titre</title>
        <script type="text/javascript" language="javascript">
          var saveWidth = 0;
     
          function clearOldValue() {
      if (document.regform.indexemail.value == "your e-mail") document.regform.indexemail.value = "";
    }
     
     
          function showFullImg(whatShow,whatHide){
            var whatShowE = document.getElementById(whatShow);
            var whatHideE = document.getElementById(whatHide);
            whatShowE.style.display = "block";
            whatHideE.style.display = "none";
          }
     
          function scaleImg(whatShow, whatHide) {
            showFullImg(whatShow, whatHide);
           var what = whatShow;
            what = document.getElementbyid(what);
            if (navigator.appName == "Netscape")
              winW = window.innerWidth;
            if (navigator.appName.indexOf("Microsoft") != -1)
              winW = document.body.offsetWidth;
            if (what.width > (720) || saveWidth > (720)) {
              if (what.width == (720))
                what.width = saveWidth;
     
              else
              {
                saveWidth = what.width;
                what.style.cursor = "pointer";
                what.width = (720);
              }
     
            }
          }
     
          function imageLoadError(){
            alert("Image wasn\'t loaded properly by your browser. <Download Image> link may still be usable, however.")
          }
          function bodyOnload(){
            if( saveWidth==0 ){
              // this is for Opera where hidden images are not loaded
              showFullImg('imageM','loading');
            }
     
            document.getElementbyid('bigImgContainer').innerHTML='<img id="image" onClick="showFullImg(\'imageM\',\'image\')"'+
                                                                 'style="display:none"'+
                                                                 'src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2.jpg" />';
     
          }
        </script>
     
     
          <style type="text/css">
              .rc {width:140px}
              .cmnt {width:490px}
          </style>
    <meta name="generator" content="Namo WebEditor"></head>
     
    <body onload='bodyOnload();'>
    <p>&nbsp;
     
     
    <table class="box" id="imageMain" width="100%">
                                  <tr>
                                      <td align="center" valign="middle" height="300">
                                          <div class="loading" id="loading">
                                              <img alt="" src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2_thumb.jpg"/>
                                              <table>
                                                  <tr>
                                                      <td><img alt="Loading" src="/images/loading.gif"/></td>
                                                      <td>Loading image... Please wait.</td>
                                                  </tr>
                                              </table>
                                          </div>
                                          <img id="imageM" onClick="showFullImg('image','imageM')"
                                               onLoad="showFullImg('imageM','loading')" style="display:none"
                                               onerror="setTimeout('imageLoadError()',1000)"
                                               src="http://www.xblogz.org/up/files/jph536kib0sexcin52n2.jpg?sizeM=3"
                                               alt="bikini azul.JPG"/>
                                          <span id="bigImgContainer"></span>
                                      </td>
                                  </tr>
     
                                  <tr>
                                      <td>
     
                                      </td>
                                  </tr>
     
     
                              </table>
     
     
     
    </body>
     
    </html>

  2. #2
    Membre expérimenté
    Profil pro
    Développeur Web
    Inscrit en
    Octobre 2006
    Messages
    251
    Détails du profil
    Informations personnelles :
    Âge : 37
    Localisation : France, Rhône (Rhône Alpes)

    Informations professionnelles :
    Activité : Développeur Web

    Informations forums :
    Inscription : Octobre 2006
    Messages : 251
    Par défaut
    Je pense que cet question devrais plutôt être dans la rubrique javascript. sinon tu peut chercher du coté de ce script : http://www.lokeshdhakar.com/projects/lightbox2/

    sinon, lorsque tu upload une image, tu devrais en créer une copie qui a une taille réduite, comme ça tu a 2 images (exemple: 1 de 10ko et 1 de 300k), alors que si tu réduis ton image en html elle fera toujours 300k

Discussions similaires

  1. Besoin d'aide pour rédiger un script
    Par superseb9 dans le forum VBScript
    Réponses: 0
    Dernier message: 25/10/2012, 14h50
  2. Réponses: 0
    Dernier message: 22/11/2008, 22h38
  3. Besoin d'aide pour installer un script PHP
    Par picasso1er dans le forum EDI, CMS, Outils, Scripts et API
    Réponses: 15
    Dernier message: 14/09/2007, 12h00
  4. Réponses: 4
    Dernier message: 14/08/2006, 15h50
  5. Besoin d'aide pour faire un script
    Par shinux2004 dans le forum Langage
    Réponses: 4
    Dernier message: 16/07/2005, 16h44

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