2

必要なjQuery UIとjQueryコアを含めましたが、それでも次のものが機能しません。

<div id="a" style="width: 500px; height: 500px; background-color: #F00; border: 1px solid #00F;">Click me</div>
<div id="b" style="width: 50px; height: 50px; background-color: #0F0; border: 1px solid #00F;"></div>

$(document).ready(function () {
    $('#a').click(function () { 
        $(this).effect(
            'transfer', 
            { to: $('#b') }, 
            1000
        ); 
    });
});​

ここで JSFiddle の例を見つけることができます

4

1 に答える 1

5

効果を得るには、jQuery UI が必要です

<link rel="stylesheet" href="http://code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css " />
<script src="http://code.jquery.com/jquery-1.8.3.js "></script> 
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js "></script>

また、次のような転送CSSが必要です

.ui-effects-transfer { ボーダー: 2px 点線グレー; }

デモンストレーション

于 2012-12-13T10:05:42.893 に答える