重要理解stop后面的两个参数作用

Original 2018-11-19 03:27:14 237
abstract:<!DOCTYPE html><html><head>  <title></title>  <script type="text/javascript" src="jquery-3.3.1.js"></script><style type="

<!DOCTYPE html>

<html>

<head>

  <title></title>

  <script type="text/javascript" src="jquery-3.3.1.js"></script>

<style type="text/css">

.box1{

  height: 200px;

  width:200px;

  background:blue;

  position: absolute;

}

</style>

<script type="text/javascript">

$(document).ready(function(){

  $('#right').click(function(){

    $('.box1').animate({ left:'500px'  },3000)

     $('.box1').animate({ fontSize:'30px'  },500)

  })

   $('#stop').click(function(){

    $('.box1').stop(true)//默认false  停止后字体继续放大,true时不放大

  })

})

</script>

</head>

<body>

<button id='right'>右移</button>

<button id='stop'>停止</button>

<div class='box1'>php中文网</div>

</body>

</html>


Release Notes

Popular Entries