jQuery UI 教程教程
jQuery UI API – 转移特效(Transfer Effect)
jQuery UI API – 转移特效(Transfer Effect)
jQuery UI API - 转移特效(Transfer Effect)
所属类别
特效(Effects)
用法
描述:把一个元素的轮廓转移到另一个元素。
	transfer
| 参数 | 类型 | 描述 | 
|---|---|---|
| className | String | 转移的元素将接收的参数化的 class 名称。 | 
| to | String | jQuery 选择器,要转移到的元素。 | 
当尝试两个元素之间的可视化交互时非常有用。
转移的元素本身带有 class ui-effects-transfer,其他的样式需要由您来定义,比如添加背景或边框。
实例
在绿色元素上点击把它转移到另一个元素。
<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>转移特效(Transfer Effect)演示</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
  <style>
  div.green {
    width: 100px;
    height: 80px;
    background: green;
    border: 1px solid black;
    position: relative;
  }
  div.red {
    margin-top: 10px;
    width: 50px;
    height: 30px;
    background: red;
    border: 1px solid black;
    position: relative;
  }
  .ui-effects-transfer {
    border: 1px dotted black;
  }
  </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>
 
<div class="green"></div>
<div class="red"></div>
 
<script>
$( "div" ).click(function() {
  var i = 1 - $( "div" ).index( this );
  $( this ).effect( "transfer", { to: $( "div" ).eq( i ) }, 1000 );
});
</script>
 
</body>
</html>
| jQuery UI API – 转移特效(Transfer Effect) | 
|---|
jQuery UI 教程
                                
                        jQuery UI 是建立在 jQuery JavaScript 库上的一组用户界面交互、特效、小部件及主题,可用于创建高度交互的 Web 应用程序。
 加载中,请稍侯......