We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 8790
    • 526 Posts
    thank you.

    I’ll have a look later. You know I’m a very beginner in JS..... I dont know JQuery but could be good to start.
    Why not Mootool ?
      Schtroumpf Grognon - Grouchy Smurf
      ---------------------------------
      Faites pas attention.. - Don't pay attention
      http://www.dzi-neo.net
      • 7923
      • 4,213 Posts
      jQuery is much easier, especially if you are a beginner. What I mean for you to do is try the following:

      1. Include jQuery js library to your site template.
      2. Change the js in afficher-vignette1 chunk to the following (this expects that you have used id="vignette[+maxigallery.picnumber+]" in the mgGalleryPicture chunk and not the name attribute):
      <script type="text/javascript">
      //<![CDATA[
      $(document).ready(function() { 
          $("#maxImage").onclick();
      });
      //]]> 
      </script>

      3. Replace the showPic function in mgJs chunk with this:
      <script type="text/javascript">
      //<![CDATA[
      function showPic(url,title,descr,width,height) {
              $("#maxImage").fadeOut("fast", function(){
              	$("#maxImage").attr({
      			src: url,
      			width: width,
      			height: height
      		});
              	$(this).fadeIn("fast");
      	});
      	$("#maxTitle").html(title);
      	$("#maxDescr").html(descr);
      }
      //]]> 
      </script>

      That showPic function will at the same time add some fade in / out transition coolness.. smiley


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 8790
        • 526 Posts
        great ! Thanks a lot.

        I’ll check it out asap.

          Schtroumpf Grognon - Grouchy Smurf
          ---------------------------------
          Faites pas attention.. - Don&#39;t pay attention
          http://www.dzi-neo.net
          • 8790
          • 526 Posts
          [edit] ok now read the end [/edit]

          hmm.

          I’m definitively a noob with those librairies ! I just can’t makeit works !

          Am I right to downlaod the jQuery here :
          http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.6.min.js

          (I also tried the non super compacted one..)
          Following word to word your suggestion, nothing happens at page loading and thumbs can’t be clickable neither

          When you propose this
          <script type="text/javascript">
          //<![CDATA[
          $(document).ready(function() { 
              $("#maxImage").onclick();
          });
          //]]> 
          </script>


          I dont see wich function is called ?? The one that is defined is function showPic in the new mgJs chunck isn’t it ?

          Found .. some typo
          first I did not understood why you targeted #maxImage as I wanted to simulated a click on the first thumb, so I changed the $("#maxImage").onclick(); into $("#vignette1").onclick();..with no more results... and js console errors too.
          until I realise reading the beginner tuto fromJQ that they use click event and not the real JS onClick event...so

          the good call might be $("#vignette1").click(); ang bingo!
            Schtroumpf Grognon - Grouchy Smurf
            ---------------------------------
            Faites pas attention.. - Don&#39;t pay attention
            http://www.dzi-neo.net
            • 7923
            • 4,213 Posts
            ok, good, great that you got it working


              "He can have a lollipop any time he wants to. That's what it means to be a programmer."