无涯教程-jQuery - Explode方法函数

爆炸效果可以与show/hide/toggle一起使用。这会将元素爆炸或分解为许多碎片。

Explode - 语法

selector.hide|show|toggle( "explode", {arguments}, speed );

这是所有参数的描述-

  • pieces    -  exploded/imploded次数。

  • model   - 动画的模式。可以设置为"显示(show)"或"隐藏(hide)"。

Explode - 示例

以下是一个简单的示例,简单说明了此效果的用法-

<html>
   <head>
      <title>The jQuery Example</title>
      <script type="text/javascript" 
         src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js">
      </script>
		
      <script type="text/javascript" 
         src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.3/jquery-ui.min.js">
      </script>
		
      <script type="text/javascript" language="javascript">
   
         $(document).ready(function() {

            $("#hide").click(function(){
               $(".target").hide( "explode", {pieces: 16 }, 2000 );
            });

            $("#show").click(function(){
               $(".target").show( "explode", {pieces: 16}, 2000 );
            });
				
         });
			
      </script>
		
      <style>
         p {background-color:#bca; width:200px; border:1px solid green;}
         div{width:100px; height:100px; background:red;}
      </style>
   </head>
	
   <body>
      <p>Click on any of the buttons</p>
		
      <button id="hide"> Hide </button>
      <button id="show"> Show</button> 
  
      <div class="target">
      </div>
   </body>
</html>

这将产生以下输出-

jQuery 中的 Explode方法函数 - 无涯教程网无涯教程网提供爆炸效果可以与show/hide/toggle一起使用。这会将元素爆炸或分解为许多碎片。 Explode...https://www.learnfk.com/jquery/effect-explode.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值