0

I have an image of 1108px height and 907 px height. I have kept this image in a div tag and its height and width is as shown

<div id="mapframe" style="overflow:hidden;height:200px;width:300px;">
<img id="image"  src="img/Groundfloor1.jpg"  height="1108px" width="907px">
</div>

Now i do not know how to display only the specified coordinates(eg 500px from top and 100px from right) of my image at the centre of the div container and the image should be a DRAGGING IMAGE like GOOGLE MAPS. I have tried it with offset but the problem with it is that my image stops dragging. Thank you for trying to help me.

4

1 回答 1

1

它需要是图像元素吗?background-image将它用作div 并使用background-position它来移动它可能会更容易。

如果你坚持有一个img元素,你也可以使用边距,但为了省去一些麻烦,我只会使用绝对定位。

于 2013-10-14T11:49:23.273 回答