2017-02-15 104 views
0

我有一个弹出的模式,我使用的是可调整大小的UI。问题在于,如果模式较高(因为它具有设定的高度因此可以滚动),图像将随滚动一起移动。我无法修复它,因为如果你抓住它并水平或垂直移动,模态就会移动。不知道该怎么办。目前它位于模式的右下角。如果需要的话,也可以使用jQuery。将图片粘贴到底部

https://jsfiddle.net/x7dw1wjg/

HTML

<div class="ui-dialog"> 
    <div class="container">//contains everything in the modal</div> 
    <div class="ui-resizable-handle ui-resizable-se ui-icon ui-icon-gripsmall-diagonal-se"> 
</div> 

CSS

.ui-dialog{ 
    width: 900px; 
    height; auto; 
    overflow: auto; 
    } 
.ui-resizable-handle { 
width: 22px; 
height: 22px; 
right: 0px; 
bottom: 0px; 
background-position: -77px -220px; // this is just the icon 
position: absolute; 
} 

.container { 
position: relative; 
padding: 1em; 
overflow: auto; 
width: auto; 
max-width: 900px; 
height: 600px; 
} 
+1

我们可以得到一个工作的例子吗? –

+0

没有图像,但我只是用一个背景色为例 – Keith

回答

0
.container img { 
height:0; 
width:50% 
padding-bottom: 50%; 
} 

这总会让其高度图像的广场上,由它的宽度。

+0

这可能是真的,但它并没有解决让它粘在页面的角落的问题。我对图像的大小没有问题。它仍然滚动页面 – Keith