Dragging an image within a CSS clip -
09-12-2008
, 01:09 PM
Hey everyone. Here's what I'm trying to accomplish.
I have an image with the following CSS applied to it:
position: absolute;
clip: rect(0px 245px 330px 0px);
top: -330px;
left: 14px;
cursor: move;
I have a "zoom" button as well. When I click that button, the image
gets replaced with a high res image, but that image stays within the
clip defined above....which is exactly waht I want it to do.
Now I want to be able to click and drag the hires image while at the
same time keeping it within the clip paramaters. Basically I want the
user to be able to drag the "zoomed" image around so they can see the
entire image if they want but the image stays in the clip.
With javascript I can drag the image around the screen, but that's not
what I'm trying to accomplish.
Any help or direction would be greatly appreciated!!
Thanks!
Jeremy |