Latest web development tutorials

jQuery UI API - ridimensionamento effetti (scala di effetto)

categoria

Effetti speciali (Effetti)

uso

Descrizione: In conformità con gli elementi della scala percentuale.

scale

参数 类型 描述 默认值
direction String 特效的方向。可能的值:"both"、"vertical" 或 "horizontal"。 "both"
origin Array 消失点。 [ "middle", "center" ]
percent Number 要缩放到的百分比。
scale String 元素的哪个区域将被调整尺寸:"both"、"box"、"content"。当值为 "box" 时,调整元素的边框(border)和内边距(padding)的尺寸。当值为 "content" 时,调整元素内的所有内容的尺寸。 "both"

Esempi

Esempio 1:

Utilizzare gli effetti di zoom (scala di effetto) di commutazione di un div.

<! Html Doctype>
<Html lang = "it">
<Head>
  <META charset = "utf-8">
  <Title> effetti di zoom (Scale Effect) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Style>
  #toggle {
    width: 100px;
    altezza: 100px;
    sfondo: #ccc;
  }
  </ Style>
  <Src = "script // code.jquery.com/jquery-1.10.2.js"> </ script>
  <Src = "script // code.jquery.com/ui/1.10.4/jquery-ui.js"> </ script>
</ Head>
<Body>
 
<P> Clicca ovunque per passare. </ P>
<Div id = "Toggle"> </ div>
 
<Script>
$ (Document) .Click (function () {
  $ ( "#toggle") .toggle ( "Scale");
});
</ Script>
 
</ Corpo>
</ Html>

Esempio 2:

Utilizzare solo gli effetti di zoom (scala effetto) in una direzione per passare un div.

<! Html Doctype>
<Html lang = "it">
<Head>
  <META charset = "utf-8">
  <Title >> effetti di zoom (Scale Effect) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Style>
  #toggle {
    width: 100px;
    altezza: 100px;
    sfondo: #ccc;
  }
  </ Style>
  <Src = "script // code.jquery.com/jquery-1.10.2.js"> </ script>
  <Src = "script // code.jquery.com/ui/1.10.4/jquery-ui.js"> </ script>
</ Head>
<Body>
 
<P> Clicca ovunque per passare. </ P>
<Div id = "Toggle"> </ div>
 
<Script>
$ (Document) .Click (function () {
  $ ( "#toggle") .toggle ({Effetto: "scala", regia: "orizzontale"});
});
</ Script>
 
</ Corpo>
</ Html>