2010-11-17 300 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; } 
相關問題