Sitemdeki resimleri resmin boyutunda ayrı pencerede nasıl açabilirim ??
Aşağıdaki javascript ve HTML kodunu kullanabilirsiniz;
Örneğin images dizini içinde "manzara.jpg" adında ve width=300, height=150 olan bir resim göstermek isterseniz:
HTML kodu aşağıdaki gibi olmalıdır;
Kod:
<script language="JavaScript">
/* javascript ile resim gösterme */
function ViewImage(ifile,ix,iy)
{
var ititle = ".:: Resim Göster ::. -- Tıklayınca kapat" ;
var win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head>"+ititle+"");
win.document.write("</head><body onBlur="self.close()" onClick="self.close()">");
win.document.write('<div style=& quot;position:absolute;width:'+ix+'px;height:'+iy+
'px;left:0px;top:0px">');
win.document.write("<img src="+escape(ifile)+"></div></body></html>");
win.document.close();
}
</script>
<script language="JavaScript">
/* javascript ile resim gösterme */
function ViewImage(ifile,ix,iy)
{
var ititle = ".:: Resim Göster ::. -- Tıklayınca kapat" ;
var win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no");
win.document.open();
win.document.write("<html><head>"+ititle+"");
win.document.write("</head><body onBlur="self.close()" onClick="self.close()">");
win.document.write('<div style=& quot;position:absolute;width:'+ix+'px;height:'+iy+
'px;left:0px;top:0px">');
win.document.write("<img src="+escape(ifile)+"></div></body></html>");
win.document.close();
}
</script>
Örneğin images dizini içinde "manzara.jpg" adında ve width=300, height=150 olan bir resim göstermek isterseniz:
HTML kodu aşağıdaki gibi olmalıdır;
Kod:
<a href= javascript:ViewImage('images/manzara.jpg',300,150) title="manzara.jpg">
<img src="images/manzara.jpg" border="0" width="300" height="150"></a>
<a href= javascript:ViewImage('images/manzara.jpg',300,150) title="manzara.jpg">
<img src="images/manzara.jpg" border="0" width="300" height="150"></a>