💎一站式轻松地调用各大LLM模型接口,支持GPT4、智谱、星火、月之暗面及文生图 广告
# jQuery UI API - 降落特效(Drop Effect) ## 所属类别 [特效(Effects)](ref-effects.html) ## 用法 **描述:**降落特效(Drop Effect)通过单个方向滑动的淡入淡出来隐藏或显示一个元素。 ``` drop ``` | 参数 | 类型 | 描述 | 默认值 | | --- | --- | --- | --- | | direction | String | 隐藏元素时元素降落的方向,显示元素时元素出现的方向。 可能的值:up、down、left、right。 | "left" | ## 实例 使用降落特效(Blind Effect)切换一个 div。 ``` <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>降落特效(Drop Effect)演示</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css"> <style> #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> </head> <body> <p>点击任意地方进行切换。</p> <div id="toggle"></div> <script> $( document ).click(function() { $( "#toggle" ).toggle( "drop" ); }); </script> </body> </html> ```