Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You have two options to sort the problem. One is to create your own helper with the function. This way you can style is any way you want, wrap it in an element, add classes, etc.</p> <p>The following demo shows the difference, the top one works, the bottom one is broken. <a href="http://jsfiddle.net/hPEAb/" rel="nofollow">http://jsfiddle.net/hPEAb/</a></p> <pre><code>$('ul').sortable({ appendTo: 'body', helper: function(event,$item){ var $helper = $('&lt;ul&gt;&lt;/ul&gt;').addClass('styled'); return $helper.append($item.clone()); } }); </code></pre> <p>The other option is not to use <code>append:'body'</code>, but to play with zIndex. Your <code>zIndex:999</code> clearly has no effect, since the default value is 1000. :) The problem with <code>zIndex</code> is that it only matters for siblings, elements within the same parent. So if you have another sortable on your form with a greater <code>zIndex</code> than your current sortable, its items could easily be on top of your dragged one, regardless of the <code>zIndex</code> of your currently dragged item.</p> <p>The solution is to push your whole sortable on top when dragging starts and restore it when it stops:</p> <pre><code>$('#mySortable').sortable({ start: function(){ // Push sortable to top $(this).css('zIndex', 999); }, stop: function(){ // Reset zIndex $(this).css('zIndex', 0); } }); </code></pre> <p>If the original value matters, you can even save the original <code>zIndex</code> with <code>.data()</code> and retrieve it afterwards.</p>
    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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      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