Anlatmak istediğim şöyle birşey :
Kod:
<script type="text/JavaScript">var actualWidth =1600 ;var actualHeight =1200;
function scaleImg() {
if (fitsInWindow())
return;what = document.getElementById('thepic');
if(what.width==tableWidth()) {
what.width=actualWidth;what.height=actualHeight;displayWarning("none");}
else
{what.style.cursor = "pointer";what.width=tableWidth();what.height = (actualHeight/actualWidth) * what.width;displayWarning("block");}}
function liveResize() {
if (fitsInWindow())
return;what = document.getElementById('thepic');
if (what.width!=actualWidth) {
what.width=tableWidth();what.height = (actualHeight/actualWidth) * what.width;displayWarning("block");}}
function setImgWidth() {
if (fitsInWindow())return;document.getElementById('thepic').width=tableWidth();displayWarning("block");
}
function fitsInWindow() {
if (actualWidth<tableWidth()) {
displayWarning("none");
document.getElementById('thelink').removeAttribute('href');
return true;
} else {
document.getElementById('thelink').setAttribute('href','Fotoparked®|Resim Yükle');
return false;
}
}
function tableWidth() {
return windowWidth()-100;}function windowWidth() {
if (navigator.appName=="Netscape")
return window.innerWidth;return document.body.offsetWidth;}
function displayWarning(how) {document.getElementById('scalewarning').style.display=how;}onresize=liveResize;
</script>
Bu kod çalışıyor fakat üzerine tıkladığında 1600*1200 e çıkarıyor.Bütün resimlerin boyutunu. O kısmı silince de çalışmıyor.
Js olarak yardımcı olabilir misiniz?