JQuery jonlantiruvchi slayd effekti

Menda textarea bor va bu matningizni bosish bilan div fadesIn va slaydlar o'ngga va loyqalab tashqariga chiqadi, lekin muammo sizni yana bosganingizda boshlang'ich nuqtadan boshlab fadesIn. Uni asl postionidan boshlash uchun bir usul bormi?

Mening html

 
 <div id="block" style="display:none;">
       

Tips

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.

</div>

Mening CSS

#block {
  position:absolute;
  left:400px;
  top:80px;
  width:500px;
  margin:0px;
  z-Index: 100;
  background-color:#FBCA8F;
color: #444;
border: 1px solid #000;
padding:10px;
line-height: 150%;
}

Javascript

$("#textarea").focus(function(){
  $("#block").fadeIn(10).animate({"left": "+=30px" },"fast");
});
 $("#textarea").blur(function(){ $("#block").animate({"left": "-=5px" },"fast").fadeOut(10);
 });

Aslida bu saytdagi matnli slaydlar tavsifi (http://www.taskrabbit.com/tasks/newfrom=howitworks) bu maqsadga qaratilgan edi, ammo bu men bilan yuzaga keladigan narsadir. Men sizga yordam beraman. Ko'p rahmat.

0

1 javoblar

Ha, javascriptda bu kabi funksiya o'zgaradi:

$("#textarea").blur(function(){ $("#block").animate({"left": "-=5px" },"fast").fadeOut(10 , function(){//put back $("#block") to his start position });});

Sizda fadeOutfunction-da qayta qo'ng'iroq qilishingiz mumkin, shuning uchun hammasi amalga oshirilganda siz o'zingiz xohlagan joyni qaytarib qo'yishingiz mumkin.

1
qo'shib qo'ydi