2010-11-17 220 views
1

身体的html代码:为什么这jQuery的简单传输效果不起作用?

<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/

下面的“摇动”效果可能会奏效,但反式FER简化版,工作 那么,如何解决这个问题?谢谢

回答

3

工作,所以你看不到边界,只要给你想要的任何类也只是无级/造型为className选项给那个班级一个边界等等......无论你想要什么样的表情。

$(this).effect("transfer", { to: "#div2", className: "myClass" }, 1000); 

随着造型该类:

.myClass { border: 2px dotted gray; } 

You can view your demo updated with these changes here

6

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

传输元件iself有 类名“UI效果转移”,并 必须由你设计,例如 通过添加背景或边框。

这是在例如

.ui-effects-transfer { border: 2px solid black; } 
相关问题