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.
.ui-resizable-handle
class. – Demonolatry