Animate border spacing - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:animate

Description

Animate border spacing

Demo Code

ResultView the demo in separate window


<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
    $(".btn1").click(function(){
        $("table").animate({borderSpacing: "10px"});
    });//  w  ww.  jav a 2s. c  o  m
    $(".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>P</td>
    <td>G</td>
  </tr>
  <tr>
    <td>A</td>
    <td>B</td>
  </tr>
</table>

</body>
</html>

Related Tutorials