/ /転送効果が機能しない(そして私はui-effects-transferのスタイルを持っています!)-jquery、jquery-ui

転送効果が働いていません(そして私はui-effects-transferのスタイルを持っています!) - jquery、jquery-ui

jQueryUI転送効果を機能させることができません。 StackOverflowに関する同様の質問は、.ui-effects-transferスタイルを指定することで解決されましたが、私にはそれがあります。 #popupから#targetへの転送効果を作成しようとしています。これが私のコードです。前もって感謝します。

    <html>
<head xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test</title>
<style type="text/css" rel="stylesheet">

.ui-effects-transfer { border: 2px dotted black; }

#popup {
position: absolute;
width: 100px;
height: 100px;
top: 20px;
left: 20px;
background-color: red;
}

#target {
position: absolute;
height: 50px;
width: 50px;
top: 500px;
left: 500px;
background-color: blue;
}
</style>

<script type="text/javascript" src="jquery-1.6.3.js"></script>
<script type="text/javascript" src="jquery.effects.core.js"></script>
<script type="text/javascript">
$(document).ready(function() {

var $popup = $("#popup");
$popup.click(function() {
$popup.effect("transfer", {to: $("#target")}, 2000);
});
});
</script>
</head>
<body>
<div id="popup">
</div>

<div id="target">
</div>
</body>

回答:

回答№1は0

私は問題を発見しました。また、jquery.effects.transferスクリプトにリンクする必要がありました。明らかに、各エフェクトには独自のjsファイルがあります。


回答№2の場合は0

クラスを追加する必要があります ui-effects-transfer オプションに追加し、ターゲットのcss識別子を指定するだけです。 to: jquery識別子として与えずに、すなわち to: "#target"

最後に、コードは次のようになります。

$popup.effect("transfer",to: "#target",className:"ui-effects-transfer" 2000);

ここでコードソースを参照してください 効果を「転送」として選択します。