jQuery UI API - ผลกระทบสไลด์ (Slide ผล)
หมวดหมู่
การใช้
คำอธิบาย: องค์ประกอบสไลด์ออกจากพื้นที่การดู
slide
参数 | 类型 | 描述 | 默认值 |
---|---|---|---|
direction | String | 特效的方向。可能的值:"left"、"right"、"up"、"down"。 | "both" |
distance | Number | 特效的距离。默认为元素的高度(height)还是宽度(width)取决于 direction 参数。可以设置为小于元素的宽度(width)/高度(height)的任意整数。 | 元素的 outerWidth |
ตัวอย่าง
ผลกระทบเลื่อน (เลื่อน Effect) เปลี่ยน div
<! Doctype html> <html lang = "th"> <head> <Meta charset = "UTF-8"> <title> ผลกระทบสไลด์ (Slide ผล) สาธิต </ title> <link rel = "สไตล์ชีต" href = "// code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <style> #toggle { ความกว้าง: 100px; ความสูง: 100px; พื้นหลัง: # 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> คลิกที่ใดก็ได้ที่จะเปลี่ยน </ p> <div id = "สลับ"> </ div> <script> $ (เอกสาร) จำนวนคลิก (ฟังก์ชั่น () { $ ( "#toggle") .toggle ( "สไลด์"); }); </ script> </ body> </ html>