English 中文(简体)
Jquery animate sliding effect
原标题:Jquery animate sliding effect
  • 时间:2011-10-28 01:02:55
  •  标签:
  • jquery

i 有一个文字区,点击该文本 右边和右边的滑坡以及bl,但问题在于你再次点击右边。 从那时起,它就开始流离失所。 是否有办法从最初的任职开始?

My html

 <textarea id="textarea" cols="50" rows="15" style="margin-top:100px;"></textarea>
 <div id="block" style="display:none;">
       <h1>Tips</h1>
         <p>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.
         </p></div>

本科

#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%;
}

Java

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

Originally the textarea slide description (http://www.taskrabbit.com/tasks/newfrom=howitworks) on that site was what i was aiming for but this is only what i could come up with. I d really appreciate any help. Many Thanks.

最佳回答

The Yeah in the javascript change the blucr function such :

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

你们对失败感到不满。 否则,你们就能够放弃你们想要它的一切。

问题回答

暂无回答




相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签