jQuery animate() border Spacing

Description

jQuery animate() border Spacing

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 a  v a 2  s  . c o m
<script>
$(document).ready(function(){
  $(".btn1").click(function(){
    $("table").animate({borderSpacing: "10px"});
  });
  $(".btn2").click(function(){
    $("table").animate({borderSpacing: "1px"});
  });
});
</script>
<style>
table {border: 1px solid black;}
td {border: 1px solid black;}
</style>
</head>
<body>

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

<table>
  <tr>
    <td>CSS</td>
    <td>HTML</td>
  </tr>
  <tr>
    <td>Java</td>
    <td>Javascript</td>
  </tr>
</table>

</body>
</html>



PreviousNext

Related