Note that there are some explanatory texts on larger screens.

plurals
  1. POCombining transfer and size effects, or combining translation and resizing
    primarykey
    data
    text
    <p>I want to invoke a command that will cause an html element and its children (call that target) to move to another html element (call that destination). As the target moves, I want it to re-size to fit the destination. </p> <p>You can visualize this as the jQuery UI transfer effect, but instead of transferring an outline, it transfers the entire element. </p> <p>I figure I could write code to asynchronously translate and perform a resize effect, but I'd prefer a less laborious process. Is there a plugin or some other canned functionality I can exploit to do this? Or would CSS3 + HTML5 allow me to easily accomplish this? </p> <p>I have two columns, 'sub' and 'main'. When I click on an element in sub, I want it to transfer to main with the desired effect. The two columns are sortable, accomplished with the JQuery UI sortable plugin. </p> <p>Here's a sample of my HTML and the relevant CSS: </p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function() { $(".column").sortable( { handle: '.widget-title', revert: true, scroll: true, placeholder: 'hover', cursor: 'move', revert: true, connectWith: ".column", opacity:0.5 } ); $( '.segment' ).addClass( 'ui-widget ui-widget-content ui-helper-clearfix ui-corner-all' ) .find('.widget-title') .addClass('ui-widget-header ui-corner-all'); }); &lt;/script&gt; </code></pre> <pre><code> &lt;div id="sub" class="column"&gt; &lt;div class="segment"&gt; &lt;ul&gt; &lt;li&gt; &lt;div class="widget-title"&gt; &lt;h4&gt;Widget 1&lt;/h4&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div class="transfer-to-main btn"&gt; &lt;p&gt;To Main&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; &lt;li&gt; &lt;div class="widget-content"&gt; &lt;p&gt;When Colonel Arcadio Buendia stood before the firing squad he thought of the day his father took him to see ice.&lt;/p&gt; &lt;/div&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; &lt;div class="segment"&gt; &lt;div class="widget-title"&gt; &lt;h4&gt;Widget 3&lt;/h4&gt; &lt;/div&gt; &lt;div class="transfer-to-main btn"&gt; &lt;p&gt;To Main&lt;/p&gt; &lt;/div&gt; &lt;div class="widget-content empty-widget"&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre class="lang-css prettyprint-override"><code>html, body, #dashboard { height: 100%; width: 100%; } ul { list-style: none; } div.column { float: left; border-style: dashed; border-width: thin; } div.empty-widget { width: 80px; height: 20px; background-color: green; } #main{ width: 50%; height: 100%; } .btn{ background-color: blue; } .ui-effects-transfer { border: 2px dotted gray; background-color: red; } #sub { width: 30% } div.segment { margin: 1em; border-style: solid; border-width: thin; } .widget-title { margin: .3em; padding-bottom: 4px; padding-left: .2em; } .ui-sortable-placeholder { border: 1px dotted black; visibility: visible !important; height: 50px !important } .ui-sortable-placeholder * {visibility: hidden;} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload