jQuery UI Resizable - How to thicken handle

跟風遠走 提交于 2019-12-05 00:48:49
.ui-resizable-s {
    bottom: 0;
    height: 10px;
}

See: http://jsfiddle.net/thirtydot/rYFEY/376/

+rgba for clarity: http://jsfiddle.net/thirtydot/rYFEY/377/

+rgba -overflow: hidden with the default bottom: -5px: http://jsfiddle.net/thirtydot/rYFEY/378/

Expanding on thirtydot: if you have multiple resizables on the same page, you may want to specify which element to act on with a child selector #resizable > .ui-resizable-s:

<style>
  #resizable > .ui-resizable-s {
    background: black;
    bottom: 0;
    height: 10px;
  }
</style>
<div id="resizable"></div>
<script>$('#resizable').resizable()</script>

This works because resizable() adds the handles inside the parent div like:

<div id="resizable">
  <div class="ui-resizable-handle ui-resizable-s"></div>    
</div>

If you want to do this for a textarea however, you have to use the sibling selector instead:

#resizable + .ui-resizable-s

because in that case jQuery UI intelligently sees that it is a textarea and puts it inside a wrapper div:

<div>
  <textarea id="resizable"></textarea> 
  <div class="ui-resizable-handle ui-resizable-s"></div>    
</div>

The best way to reach those conclusions is to run your browser's DOM inspector (Ctrl+Shirt+I on Firefox and Chrome) to see what jQuery UI is doing to your HTML.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!