gpt4 book ai didi

jquery - 为什么这个jquery简单的转移效果不起作用?

转载 作者:行者123 更新时间:2023-12-01 06:16:18 24 4
gpt4 key购买 nike

正文 html 代码:

<div style="background:yellow;width:500px;height:300px;">
<div id="div1" style="background:red; width:100px;height:100px; float:left;"></div>
<div id="div2" style="background:blue; width:50px;height:50px; float:right;"></div>
</div>

然后是js代码:

 $(function () {
$("#div1").click(function () {
$(this).effect("transfer", { to: $("#div2") }, 1000);
//$(this).effect("shake", { times: 2 }, 200);
});
});

当然我已经导入了

<script type="text/javascript" src="js/jquery-ui-1.8.5.custom.min.js"></script>

网上可以看到不好的:http://jsfiddle.net/hh54188/wz2J3/

下面的“摇一摇”效果可以,但是传输不起作用那么,如何解决这个问题?谢谢

最佳答案

来自http://docs.jquery.com/UI/Effects/Transfer

The transfer element iself has the class name "ui-effects-transfer", and needs to be styled by you, for example by adding a background or border.

这在示例中

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

关于jquery - 为什么这个jquery简单的转移效果不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4200911/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com