在jQuery UI可选演示页面: http://jqueryui.com/demos/selectable/#default,当您选择元素时,您可以看到选择框大纲.当我尝试时,怎么会出现这种情况? 这不是我的小提琴,但它也有同样的问题: http
这不是我的小提琴,但它也有同样的问题:
http://jsfiddle.net/jMDVm/40/
.ui-selectable-helper { position: absolute; z-index: 100; border: 1px dotted black; }
$(document).ready(function() { $("#selectable").selectable({ selected: function(event, ui) { $('.status').text("Selected"); }, selecting: function(event, ui) { $('.status').text("Selecting"); } }); });
#wrapper { width: 250px; height: 100px; } #selectable { background: black; width: 250px; height: 16px; } #selectable .ui-selecting { background: silver; } #selectable .ui-selected { background: gray; } #selectable div { background-color: #777; } .ui-selectable-helper { position: absolute; z-index: 100; border: 1px dotted black; }
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.js"></script> <div id="wrapper"> <div id="selectable"> <div>Hello</div> <div>Select</div> <div>Me</div> </div> </div> <div class="status"></div>