I am facing an issue with a div on my website that has specific properties:
#viewport{
overflow: hidden;
display: block;
position: relative;
width: 323px;
height: 323px;
}
Embedded within this div is an element with the following properties:
#image{
display: block;
position: absolute;
}
Users can drag the image within the viewport using jQuery draggable functionality. However, whenever the image overflows, it gets hidden. The dragging function works fine until I try to adjust the height and width using $.height()
and $.width()
. Strangely, the height changes perfectly, but the width only changes if it's less than 323 pixels, the width of the viewport. It refuses to go wider than 323 pixels. Meanwhile, the height keeps expanding outside the viewport without issues. The rate at which both width and height expand is the same, and upon checking the values used for width and height, they appear correct. The width issue persists. Can anyone shed light on why this might be happening specifically with the width?