jquery - 占位符未在 jquery 可排序、拖放中显示

标签 jquery jquery-ui-sortable

我无法在 div 中显示可排序项目的占位符。

<script type="text/javascript">
$(function() {
$("#userContent").sortable({
        handle: '.close_button',
        connectWith: '#userContent',
        placeholder: 'placeholder',  
        forcePlaceholderSize: true,
        tolerance: 'pointer',
        revert: true,
    });
});
</script>
<style type="text/css">
.webtitle_paragraphs {
    width:98%;
    float:left;
    border:1px solid #0099CC;
    margin:5px;
}
.close_button {
    display:block;
    overflow:visible;
    visibility:visible;
    height:20px;
    background:#0099CC;
    width:100%;
}
.placeholder {
    background: #f0f0f0;
    border:1px dashed #ddd;
    visibility: visible !important;
}

.webtitle input {
    width:98%;
    font: bold 20px verdana;
    border:0px;
}
.paragraph_txt textarea {
    width:98%;
    height:auto;
    border:0px;
}
</style>

<div id="userContent">
  <div class="webtitle_paragraphs" id="div4463_text">
    <div class="close_button" id="close_4463"><a onclick="removeDiv('div4463_text');"><img src="images/close_button.png" alt="close" width="15" height="15" border="0" align="right"/></a></div>
    <div class="webtitle_paragraph">
      <div class="webtitle">
        <input value="Title" name="webtitle4463"  type="text" class="text _4463" />
      </div>
    </div>
  </div>
  <div class="webtitle_paragraphs" id="div7192_image">
    <div class="close_button" id="close_7192"><a onclick="removeDiv('div7192_image');"><img src="images/close_button.png" alt="close" width="15" height="15" border="0" align="right"/></a></div>
    <div class="webtitle_paragraph">
      <div class="paragraph"><img src="https://localhost/web20/user_site_designs/images/noImage.jpeg" id="img7192" class="imageCntrl"/>
        <input type="hidden" name="imgName7192" id="imgName7192" value="" class="image _7192"/>
      </div>
    </div>
  </div>
  <div class="webtitle_paragraphs" id="div9683_paragraph">
    <div class="close_button" id="close_9683"><a onclick="removeDiv('div9683_paragraph');"><img src="images/close_button.png" alt="close" width="15" height="15" border="0" align="right"/></a></div>
    <div class="webtitle_paragraph">
      <div class="paragraph_txt">
        <textarea class="paragraph _9683" name="myTextarea9683" id="myTextarea9683">Paragraphp</textarea>
      </div>
    </div>
  </div>
</div>

最佳答案

将 float:left 添加到 .placeholder 样式。

此外,revert:true 之后还有一个逗号,但它不应该出现在此处。

关于jquery - 占位符未在 jquery 可排序、拖放中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2586029/

相关文章:

jquery - 动画功能比其他功能完成

javascript - jquery-ui-sortable 的拖动事件

javascript - Jquery:form.submit() 有效但 form.submit(handler) 无效

插入新对象时 Meteor 0.8.2 客户端集合为空

javascript - jQuery 可从一个 div 排序到另一个

jquery - 如何在可排序列表中排除某个元素被拖动?

javascript - 数组值在 jquery 可排序中无法正确获取

javascript - 使用 jquery 进行文本操作

jquery - div 容器内的 iframe,作为窗口模态

javascript - 使用 angularjs 的货币转换器