Latest web development tutorials

jQuery UI API - efek geser (Efek Slide)

kategori

efek khusus (Efek)

pemakaian

Keterangan: Elemen-elemen geser keluar dari area tampilan.

slide

参数 类型 描述 默认值
direction String 特效的方向。可能的值:"left"、"right"、"up"、"down"。 "both"
distance Number 特效的距离。默认为元素的高度(height)还是宽度(width)取决于 direction 参数。可以设置为小于元素的宽度(width)/高度(height)的任意整数。 元素的 outerWidth

contoh

Efek Sliding (Efek Slide) beralih div.

<! DOCTYPE html>
<Html lang = "en">
<Head>
  <Meta charset = "utf-8">
  <Title> efek geser (Slide Effect) 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 ( "Slide");
});
</ Script>
 
</ Body>
</ Html>