popUp dimension...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • riki

    popUp dimension...

    hi,
    in one folder i've put all pics, but they are not all the same size. i've
    got as many links as pics and clicking on link popUp opens showing that pic.
    now, i would like to have one function that opens popUp window but in
    different dimension for different pic.
    i.e.
    <A href="#"
    onClick="javasc ript:window.ope n('/path/pic.jpg','','wi dth=[PIC.WIDTH],height
    =[PIC.HEIGHT],
    toolbar=0,locat ion=0,directori es=0,menuBar=0, scrollBars=no,r esizable=1');">
    <STRONG>Enlar ge pic</STRONG></A>

    how can i get PIC.WIDTH and PIC.HEIGHT?
    thanks


  • lallous

    #2
    Re: popUp dimension...

    Hi,

    check http://bugimus.com/gurus/image_popup/imagepopup.html

    --
    Elias


    "riki" <riki_fox@hotma il.com> wrote in message
    news:br1tir$tdp $1@ls219.htnet. hr...[color=blue]
    > hi,
    > in one folder i've put all pics, but they are not all the same size. i've
    > got as many links as pics and clicking on link popUp opens showing that[/color]
    pic.[color=blue]
    > now, i would like to have one function that opens popUp window but in
    > different dimension for different pic.
    > i.e.
    > <A href="#"
    >[/color]
    onClick="javasc ript:window.ope n('/path/pic.jpg','','wi dth=[PIC.WIDTH],height[color=blue]
    > =[PIC.HEIGHT],
    >[/color]
    toolbar=0,locat ion=0,directori es=0,menuBar=0, scrollBars=no,r esizable=1');">[color=blue]
    > <STRONG>Enlar ge pic</STRONG></A>
    >
    > how can i get PIC.WIDTH and PIC.HEIGHT?
    > thanks
    >
    >[/color]


    Comment

    • @SM

      #3
      Re: popUp dimension...

      riki a ecrit :
      [color=blue]
      > i would like to have one function that opens popUp window but in
      > different dimension for different pic.[/color]

      <script type="text/javascript"><!--
      truc=false;
      function pop(larg,haut){
      if(truc!=false || !truc.closed){t ruc.close(); truc=false;}
      else
      truc=window.ope n('','VoirIci', 'width='+larg+' ,height='+haut' ,resizable=1');
      }
      // --></script>
      <a href="../path/image_1.jpg" target="VoirIci "
      onclick="pop(24 5,123);">Image 1</a>

      If JS is unactive ==> a new window will open
      If JS ==> a new nake window with right dimensions will open
      and the html will send the image to the target "VoiIci" wich is in the popup.

      --
      *************** *************** *************** *************** **
      Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
      Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

      *************** *************** *************** *************** **


      Comment

      • riki

        #4
        Re: popUp dimension...

        [color=blue]
        > <script type="text/javascript"><!--
        > truc=false;
        > function pop(larg,haut){
        > if(truc!=false || !truc.closed){t ruc.close(); truc=false;}
        > else
        >[/color]
        truc=window.ope n('','VoirIci', 'width='+larg+' ,height='+haut' ,resizable=1');[color=blue]
        > }
        > // --></script>
        > <a href="../path/image_1.jpg" target="VoirIci "
        > onclick="pop(24 5,123);">Image 1</a>[/color]

        yes, but now i have to manualy insert width and height in the
        pop(width,heigh t) function and i would like something like this if it is
        possible

        onclick="pop(ge tImage[imgPath/imgName].getWidth,
        getImage[imgPath/imgName].getHeight);">I mage 1</a>

        i don't know if i explained it right.
        thanks.




        Comment

        • @SM

          #5
          Re: popUp dimension...

          riki a ecrit :
          [color=blue]
          > yes, but now i have to manualy insert width and height in the
          > pop(width,heigh t) function and i would like something like this if it is
          > possible
          >
          > onclick="pop(ge tImage[imgPath/imgName].getWidth,
          > getImage[imgPath/imgName].getHeight);">I mage 1</a>[/color]

          <SCRIPT LANGUAGE="JavaS cript">
          /*
          SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT

          Ne copiez ce code qu'une fois dans votre page
          Copy this code only once in your page
          */
          function afficheVignette (cheminVignette ,cheminMaxi)
          {
          document.write( '<A HREF="javascrip t:afficheMaxi(\ ''+cheminMaxi+
          '\')"><IMG SRC="'+cheminVi gnette+
          '" HSPACE=0 VSPACE=0 BORDER=0 ALT="cliquez ici pour voir en grand"></A>');
          }
          function afficheMaxi(che min) // chemin = path to big photo file
          {
          i1 = new Image;
          i1.src = chemin;
          html = '<HTML><HEAD><T ITLE>Image</TITLE></HEAD>'+
          '<BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0> '+
          '<CENTER><IMG SRC="'+chemin+' " BORDER=0 NAME=imageTest onLoad="'+
          window.resizeTo (document.image Test.width,docu ment.imageTest. height)">'+
          '</CENTER></BODY></HTML>';
          popupImage = window.open('', '_blank','menuB ar=0,scrollbars =0,resizable=1' );
          popupImage.docu ment.open();
          popupImage.docu ment.write(html );
          popupImage.docu ment.close()
          };
          </SCRIPT>

          To use this script :
          insert in your page each time there where you need an image "zoommable"
          <p><SCRIPT LANGUAGE="JavaS cript">
          affiche('path_t humbnails/Img1.jpg','path _tall_Photos/Img1.jpg');
          </script>
          <p><SCRIPT LANGUAGE="JavaS cript">
          affiche('path_t humbnails/Img2.jpg','path _tall_Photos/Img2.jpg');
          </script>

          could be replaced by :
          <A HREF="javascrip t:afficheMaxi(' path_big_Photos/Img1.jpg');
          "><IMG SRC="path_thumb nails/Img1.jpg" HSPACE=0 VSPACE=0 BORDER=0
          ALT="Clicable picture" TITLE="Click me to see me in tall"></A>
          <A HREF="javascrip t:afficheMaxi(' path_big_Photos/Img2.jpg');
          "><IMG SRC="path_thumb nails/Img2.jpg" HSPACE=0 VSPACE=0 BORDER=0
          ALT="Clicable picture" TITLE="Click me to see me in big"></A>

          You probably will have to adapte to be compatible with DOM

          --
          *************** *************** *************** *************** **
          Stéphane MORIAUX : mailto:stephane OTER-MOImoriaux@wana doo.fr
          Aide aux Pages Perso (images & couleurs, formulaire, CHP, JS)

          *************** *************** *************** *************** **


          Comment

          • riki

            #6
            Re: popUp dimension...

            thank you very much


            Comment

            Working...