Latest web development tutorials

jQuery UI API - explosion effects (Explode Effect)

category

Special effects (Effects)

usage

Description: The explosion effects (Explode Effect) by splinter elements to hide or show an element.

explode

参数 类型 描述 默认值
pieces Integer 爆炸裂开的碎片数目,应该是个平方数,任何其他值被舍入到最近的平方数。 9

Examples

Use explosion effects (Explode Effect) switching a div.

<! Doctype html>
<Html lang = "en">
<Head>
  <Meta charset = "utf-8">
  <Title> explosion effects (Explode Effect) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Style>
  #toggle {
    width: 100px;
    height: 100px;
    background: #ccc;
  }
  </ Style>
  <Script src = "// code.jquery.com/jquery-1.10.2.js"> </ script>
  <Script src = "// code.jquery.com/ui/1.10.4/jquery-ui.js"> </ script>
</ Head>
<Body>
 
<P> Click anywhere to switch. </ P>
<Div id = "toggle"> </ div>
 
<Script>
$ (Document) .click (function () {
  $ ( "#toggle") .toggle ( "Explode");
});
</ Script>
 
</ Body>
</ Html>