Latest web development tutorials

jQuery UI API - efek bouncing (Bounce Efek)

kategori

efek khusus (Efek)

pemakaian

Keterangan: efek rebound (Bounce Efek) menggalang elemen. Ketika digunakan bersama dengan menyembunyikan atau menunjukkan terakhir kali, atau pada bouncing pertama akan menunjukkan efek / fade-out fade-in.

bounce

参数 类型 描述 默认值
distance Number 最大的反弹距离,以像素为单位。 20
times Integer 元素反弹的次数。当隐藏或显示时,会为淡入/淡出效果添加半个反弹。 5

contoh

Gunakan efek rebound (Bounce Efek) beralih div.

<! DOCTYPE html>
<Html lang = "en">
<Head>
  <Meta charset = "utf-8">
  <Title> pulih efek (Bounce Efek) Demo </ title>
  <Link rel = "stylesheet" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <Gaya>
  #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>
</ Kepala>
<Body>
 
<P> Klik di mana saja untuk beralih. </ P>
<Div id = "beralih"> </ div>
 
<Script>
$ (Dokumen) .Klik (function () {
  $ ( "#toggle") .toggle ( "Bounce", {kali: 3}, "lambat");
});
</ Script>
 
</ Body>
</ Html>