1. test.aspx
<img src='upLoadFiles/newCar/62320080319182515.jpg'
                                   alt='image'
                                   width="60"
                                   height="50" 
                                   class="carInfoImageList"
                                   style="cursor:hand;"
                                   onclick="LoadBigPic('upLoadFiles/newCar/62320080319182515.jpg')" onerror="this.src='/images/wutu.jpg'" />
 <img src='upLoadFiles/newCar/62320080319182515.jpg'
                                   alt='image'
                                   width="60"
                                   height="50" 
                                   class="carInfoImageList"
                                   style="cursor:hand;"
                                   onclick="LoadBigPic('upLoadFiles/newCar/62320080319182515.jpg')" onerror="this.src='/images/wutu.jpg'" />
 <img src='upLoadFiles/newCar/62320080319182515.jpg'
                                   alt='image'
                                   width="60"
                                   height="50" 
                                   class="carInfoImageList"
                                   style="cursor:hand;"
                                   onclick="LoadBigPic('upLoadFiles/newCar/62320080319182515.jpg')" onerror="this.src='/images/wutu.jpg'" />
 <img src='upLoadFiles/newCar/62320080319182515.jpg'
                                   alt='image'
                                   width="60"
                                   height="50" 
                                   class="carInfoImageList"
                                   style="cursor:hand;"
                                   onclick="LoadBigPic('upLoadFiles/newCar/62320080319182515.jpg')" onerror="this.src='/images/wutu.jpg'" />
<a href="javascript:window.open('ViewImage.htm.htm','','width=750px,height=600px,top=20px,left=200px, status=no, scrollbars=yes')"  target="_blank"><img src="upLoadFiles/<% =ImgType%>/<% =BigImgUrl%>" )
   
       {
          photos.push(images[i].src);
       }
    }
   

    }
   
   function resizeImage(obj, MaxW, MaxH)
 {
    var imageObject = obj;

     if(imageObject.readyState!='complete')
       {

         return false;
      }
   
   
    var oldImage = new Image();
    oldImage.src = imageObject.src;
    var dW = oldImage.width;
    var dH = oldImage.height;
    if(dW>MaxW || dH>MaxH)
     {
          a = dW/MaxW;
           b = dH/MaxH;
             if( b>a ) a = b;
            dW = dW/a;
            dH = dH/a;
       }
     if(dW > 0 && dH > 0)
      {
         imageObject.width = dW;
         imageObject.height = dH;
     }
}

 


    function showImage()
    {
        if (photos.length > 0)
        {
         
            var image = document.getElementById('imgPhoto');
            image.src = photos[nFlag];
   
         if(nFlag==0)
         {
          document.getElementById("BtnPre").disabled=true;
         }
         else
         {
          document.getElementById("BtnPre").disabled=false;
         }
       
           
         if( nFlag==(photos.length-1) )
         {
          document.getElementById("BtnNext").disabled=true;
         }
         else
         {
          document.getElementById("BtnNext").disabled=false;
         }
        

         if(image)
          {
              resizeImage(image,600,450);
          }
        }
       
     
    }
   
    function next()
    {
      if (photos.length > 0)
        {
       
         if( nFlag<photos.length-1)
         {
           nFlag++;
         }
        
         showImage();
        
        
        }
     
    }  
   
    function pre()
    {
      if (photos.length > 0)
        {
       
       
         if( nFlag>0)
         {
           nFlag --;
         }
        
         showImage();
        
       
        }
     
    }  
   
    function clickImage(image)
    {
   
    var index=-1;
    for(var i=0;i<photos.length;i++)
    {
       if(getImageUrl(photos[i])==getImageUrl(image.src))
       {
       index=i;
       break;
       }
      
    }
   
    if(index>-1)
    {
      nFlag=index;
      showImage();   
    }
   
   
    }
   
    function getImageUrl(sUrl)
    {
      var index=sUrl.lastIndexOf("/");
      var url=sUrl.substring(index+1);
      return url;
    }
   
  
    function getTitle()
    {
      
   
      // document.title= window.opener.document.getElementById("newCarTitle").innerHTML;
   
    }
  
    </script>

</head>
<body onload="getImages();showImage();getTitle();" style="text-align:center; padding:20px  auto 0 auto; background-color:#505050;">

   
    <div>

    <img /></td>
            </tr>
        
        </table>
    </div>

</body>
</html>

相关文章:

  • 2021-11-15
  • 2021-06-01
  • 2021-08-18
  • 2022-12-23
  • 2022-01-21
  • 2022-01-07
  • 2021-11-02
  • 2022-02-21
猜你喜欢
  • 2021-08-12
  • 2021-06-19
  • 2021-11-11
  • 2021-12-28
  • 2021-08-05
相关资源
相似解决方案