Latest web development tutorials

jQuery UI API - escalar efectos (efecto) Escala

categoría

efectos especiales (Efectos)

uso

Descripción: De acuerdo con una serie de elementos escala porcentual.

scale

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

Ejemplos

Ejemplo 1:

Utilice los efectos de zoom (Escala efecto) de conmutación un div.

<! DOCTYPE html>
<Html lang = "es">
<Head>
  <Charset Meta = "UTF-8">
  <Title> efectos de zoom (Escala de Efecto) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Style>
  #toggle {
    Anchura: 100px;
    altura: 100px;
    fondo: #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>
<Cuerpo>
 
<P> Haga clic en cualquier lugar para cambiar. </ P>
<Div id = "cambiar"> </ div>
 
<Script>
$ (Document) .click (function () {
  $ ( "#toggle") .toggle ( "Escala");
});
</ Script>
 
</ Body>
</ Html>

Ejemplo 2:

Utilice únicamente los efectos de zoom (Escala de efecto) en una dirección para cambiar un div.

<! DOCTYPE html>
<Html lang = "es">
<Head>
  <Charset Meta = "UTF-8">
  <Título >> efectos de zoom (Escala de Efecto) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Style>
  #toggle {
    Anchura: 100px;
    altura: 100px;
    fondo: #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>
<Cuerpo>
 
<P> Haga clic en cualquier lugar para cambiar. </ P>
<Div id = "cambiar"> </ div>
 
<Script>
$ (Document) .click (function () {
  $ ( "#toggle") .toggle ({Efecto: "escala", dirección: "horizontal"});
});
</ Script>
 
</ Body>
</ Html>