jquery stop()metodu true , false değerleri

standart olarak false değerine sahiptir. Eğer stop (true,true) olarak ayarlanırsa animasyonu bitirir. stop (true,false ) olarak belirlenirse animasyonu o anda durdurur
    

 <style>
#nesne {
    position: absolute;
    background:#066;
    left: 15px;
    top: 30px;
    width: 60px;
    height: 60px;
    margin: 5px;
  }
#dis{
    width:460px;
    height:260px;
    border:1px dashed #069;
overflow:hidden;}
 </style>

<button id="ileri">ileri</button>
<button id="geri">geri</button>
<button id="asagi">asagi</button>
<button id="yukari">yukari</button>
<button id="dur1">DURDUR (true,true)</button>
<button id="dur2">DURDUR (true,false)</button>
<div id="dis">
<div id="nesne"></div>
</div>


<script> 
$( "#dur1" ).click(function() {
  $( "#nesne" ).stop(true,true);
});
$( "#dur2" ).click(function() {
  $( "#nesne" ).stop(true,false);
});

$( "#ileri" ).click(function() {
  $( "#nesne" ).animate({ left: "+=200px" }, 2000 );
}); 

$( "#geri" ).click(function() {
  $( "#nesne" ).animate({ left: "-=100px" }, 2000 );
});

$( "#asagi" ).click(function() {
  $( "#nesne" ).animate({ top: "+=200px" }, 2000 );
});
$( "#yukari" ).click(function() {
  $( "#nesne" ).animate({ top: "-=200px" }, 2000 );
});
</script>

Programın Çıktısı

Mesaj ve Yorumlar

Yorum Sayısı (0)

ÜYE YORUMLARI

Çevrimiçi :
11
Günlük :
156
Haftalık :
437
Aylık :
1487
Copyright © 2010 İşbara Alp Sönmez – Programlama Örnekleri. Her hakkı saklıdır. www.alpsonmez.com Bu sitedeki herhangi bir içeriğin, "herhangi bir sitede veya forumda" iznim dışında paylaşım yapılması durumunda hukuki dava açacağımı tarafınıza arz ederim. "Öğrenciler dilediği gibi kullanabilir."