jQuery ui ReSizable带滚动条 [英] jQuery ui ReSizable with scroll bars
问题描述
我正在尝试在div上设置resizable,但是resizer句柄总是包含在div中我可以在滚动条结束的地方使用它。
I am trying to have a resizable on a div, but the resizer handle is always contained within the div can I have it where scrollbars end.
///////////编辑///////////
/////////// Edit ///////////
我用jScrollPane实现了它,但在使用jScroll之后我无法横向调整大小。
演示http://i53.tinypic.com/906rk9.png
I have achieved it with jScrollPane but after using jScroll I am unable to resize horizontally.
demo http://i53.tinypic.com/906rk9.png
推荐答案
如果你在要调整大小的元素周围放置一个包装器,并使这个包装器可以调整大小,它应该可以工作。
It should work, if you put a wrapper around the element to be resized, and make this wrapper resizable.
我正在玩这个想法,这个结果似乎有效:
I was playing around with that idea and this result seems to work:
<script>
$(document).ready(function() {
$(".resizable")
.wrap('<div/>')
.css({'overflow':'hidden'})
.parent()
.css({'display':'inline-block',
'overflow':'hidden',
'height':function(){return $('.resizable',this).height();},
'width': function(){return $('.resizable',this).width();},
'paddingBottom':'12px',
'paddingRight':'12px'
}).resizable()
.find('.resizable')
.css({overflow:'auto',
width:'100%',
height:'100%'});
});
</script>
这篇关于jQuery ui ReSizable带滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!