Im Grunde habe ich 2 Listen mit "Widgets" in jedem und einige von ihnen können ziemlich groß sein. Ich habe alle den Code auf diese vereinfacht. Hier ist das Javascript
<script type="text/javascript">
$(function() {
$(".homepage-right" ).sortable({
revert: 200,
connectWith:["#homepage-left","#homepage-right"],
placeholder: "homepage-element-placeholder",
cancel: ".homepage-disable-drag",
opacity:0.7,
distance:30,
handle:".box-title",
start: function (event,ui) {
height = $(ui.item).outerHeight();
left_height = $("#homepage-right").height();
$("#homepage-left").attr(\'height\',(height+left_height)+\'px\');
$(".homepage-left" ).css(\'padding-bottom\',height*2);
$(".homepage-element-placeholder").css(\'height\',height);
},
receive: function(event,ui) {
homepage_reload_node(event,ui,2);
},
stop: function(event,ui) {
homepage_save_layout();
$(".homepage-left" ).css(\'padding-bottom\',\'0px\');
$(".homepage-right" ).css(\'padding-bottom\',\'0px\');
}
});
$(".homepage-left" ).sortable({
revert: 200,
connectWith:["#homepage-left","#homepage-right"],
placeholder: "homepage-element-placeholder",
cancel: ".homepage-disable-drag",
opacity:0.7,
handle:".box-title",
start: function (event,ui) {
height = $(ui.item).outerHeight();
left_height = $("#homepage-right").height();
$("#homepage-right").attr(\'height\',(height+left_height)+\'px\');
$(".homepage-right" ).css(\'padding-bottom\',height*2);
$(".homepage-element-placeholder").css(\'height\',height);
},
receive: function(event,ui) {
homepage_reload_node(event,ui,1);
},
stop: function(event,ui) {
homepage_save_layout();
$(".homepage-left" ).css(\'padding-bottom\',\'0px\');
$(".homepage-right" ).css(\'padding-bottom\',\'0px\');
}
});
});
</script>
und hier ist die html
<div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div>
</div>
<div id="homepage-left" class="homepage-left">
<div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div><div class="box_white" style=";" id="homepage_object_5">
<div class="box-title"><div style="float:right;">
<a href="javascript:;"><img class="home_remove_button" onclick="homepage_node_delete(5);" align="right" src="cross.jpg" style="vertical-align:middle;" border="0" alt="Remove"/></a></div><h3 >title</a></h3><div class="clear"></div></div>
<div class="box-content" ><div style="text-align:center;margin-top: 10px;">
some content
</div>
</div>
</div>
</div>
Sie sind im Grunde 2 Listen, eine etwas breiter als die andere. Das Problem, das ich habe, ist, dass der Platzhalter nicht erscheint, wenn ich ein Element vom unteren Ende einer Liste in eine andere ziehe. Ich habe (wie Sie sehen) versucht, zusätzliche Höhe und Polsterung beim Ziehen hinzufügen, aber es scheint nicht zu helfen. Der Platzhalter und damit das Ziehen ist nur verfügbar, wenn Sie Ihr Widget holen und dann das untere Ende des vorherigen berühren. Gibt es eine Lösung für dieses Problem? Vielen Dank Richard