View Single Post
Sponsorlu Bağlantılar
Zoque.Forum
Advertisement
Old 15.10.2007   #3 (permalink)
$BABACAN
 
Üyelik Tarihi: 08.06.2007
Yer: Eskişehir
Mesaj: 32
Re: üzerine tıklayınca orjinal boyut

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?
$BABACAN şu an çevrimdışı   Mesajdan alıntı yaparak yeni bir cevap ekleyin