jQuery animate() text Indent

Description

jQuery animate() text Indent

View in separate window



<!DOCTYPE html>
<html>
<head>
<script 
 src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js">
</script>//  w w w .j  av  a2 s .c  o m
<script>
$(document).ready(function(){
  $(".btn1").click(function(){
    $("p").animate({textIndent: "30px"});
  });
  $(".btn2").click(function(){
    $("p").animate({textIndent: "0px"});
  });
});
</script>
</head>
<body>

<button class="btn1">Animate</button>
<button class="btn2">Reset</button>

<p>This is a paragraph. This is some more text. This is some more text. 
This is some more text. This is some more text. This is some more text. 
This is some more text. This is some more text. This is some more text. 
This is some more text. This is some more text. This is some more text. 
This is some more text. This is some more text.</p>

</body>
</html>



PreviousNext

Related