Örnek:
http://wallpaper.skins.be/katherine-heigl/29358/1280x800/
hotscripts.com'da aradım ama orda da bir şey bulamadım,
http://wallpaper.skins.be/katherine-heigl/29358/1280x800/
hotscripts.com'da aradım ama orda da bir şey bulamadım,
var actualWidth = 1280; var actualHeight = 1024; var message; var b_fullsize=0;
function tableWidth()
{return windowWidth()-600;}
function windowWidth() {
if (navigator.appName=="Netscape")
return window.innerWidth;
return document.body.offsetWidth;
}
function scaleImg() {
what = document.getElementById('thepic');
actualHeight=what.height; actualWidth=what.width;
if ( fitsInWindow() ) return;
if(what.width==tableWidth())
{what.width=actualWidth;what.height=actualHeight;}
else{
what.style.cursor = "pointer";
what.width=tableWidth();what.height = (actualHeight/actualWidth) * what.width;
}
}
function showOnclick()
{
what = document.getElementById('thepic');
if (actualWidth == what.width)
return scaleImg();
else if (actualWidth > what.width)
{
what.width=actualWidth;
what.height=actualHeight;
}
}
function liveResize() {
what = document.getElementById('thepic');
actualHeight=what.height; actualWidth=what.width;
if (fitsInWindow())return;
if (what.width!=actualWidth) {
what.width=tableWidth();what.height = (actualHeight/actualWidth) * what.width;}}
function setImgWidth(){
if (fitsInWindow())return;
document.getElementById('thepic').width=tableWidth();
}
function fitsInWindow() {
what = document.getElementById('thepic');
var actualWidth= what.width;
if (actualWidth<tableWidth()) {
displayWarning("none");
return true;
} else {
return false;
}
}
<img id="thepic" onClick="showOnclick()" onLoad="scaleImg()" src="http://Resim Linki" />
<script language="Javascript">
function degistir () {
var image = document.getElementById('myimage');
image.width = '500';
image.height = '500';
}
function duzelt () {
var image = document.getElementById('myimage');
image.width = '200';
image.height = '200';
}
</script>
<img id="myimage" onClick="degistir()" onmouseout="duzelt()" src="http://www.pcmahkumlari.com/avatars/Actors/Brad_Pitt.jpg" width="200" height="200">