:::: 개발 ::::/::: JSCRIPT :::

이미지 사이즈 팝업

nayha 2010. 7. 14. 14:44
반응형

<script language="JavaScript">
요건 잘 안먹히고 -ㅅ- ;;
function ViewImg(ImgName, Imgsrc)
{

file="ViewImg.asp?imgsrc="+Imgsrc;
var window_width = ImgName.width;
var window_height = ImgName.height;
var window_left = (screen.availWidth-window_width)/2;
var window_top = (screen.availHeight-window_height)/2;
//alert(window_left+","+window_top);
//alert(window_left);
window.open(file,'NewWin','width=' + window_width + ',height=' + window_height + ',top=' + window_top + ',left=' + window_left + ''); 
}

요건 잘되더라구~우
function viewPic(test,img){
//alert(img);
  foto1= new Image();
  foto1.src=(img);
  contImg(img);
}
function contImg(img){
  if((foto1.width!=0)&&(foto1.height!=0)){
    RealviewImg(img);
  }
  else{
    funzione="contImg('"+img+"')";
    intervallo=setTimeout(funzione,20);
  }
}
function RealviewImg(img){
  largh=foto1.width+20;
  altez=foto1.height+20;
  stringa="width="+largh+",height="+altez;
  finestra=window.open(img,"",stringa);
}

</script>
반응형