开发者

In css or jquery, is there a way I can add something to my border on a div?

Is there a way I can put little squares around a div to make it look like handles, one top middle, top left, top right, middle left, middle right, bottom left, bottom right, bottom middle. I have this j开发者_Go百科query plugin and I have a div resizeable, but I wanted to know how I could make it look like it has handles. Most likely in css, but maybe theres a way in jquery? Open to either suggestions. Thanks!


If your <div> is not static-ally positioned, (position: relative works too) then anything within it which is absolute-ly positioned will refer to it. Makes nice handles.


Depending on your app, (and what you need to support) the CSS3 property border-image may be an option. If the border is used to indicate JavaScript functionality, this CSS would be best applied with JavaScript in a progressively enhanced manner.


You just need a bottom-right positioned background image. See http://jqueryui.com/demos/resizable/

Check the jQuery UI Resizable demo - see how they've done it?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜