Jump to content

Is this possible?


RAZZ

Recommended Posts

Hi,First cosider this code:

<div style="height: 200px; width: 200px;"><img Id="anImage" src="image.jpg"/></div>

So let's say I move the image around with java script or something.Is it possible to only make the image show if it is inside the boudaries of the div?I mean, so I will only see half the image, if I move it half way out of the div?Thank you in advance.

Link to comment
Share on other sites

Yes i think so, you could have divs at the boundry with a higher z-index than the image so if the image went into there boundry the image would disapear beneth them.Maybe there are other ways but that sprung to mind :)

Link to comment
Share on other sites

I don't think it'd be that simple. To move the picture around with javascript I think you would have to make the image positioned absolute, and so it would jump out of parent area anyway, unless you just so happen to position it above the parenting div.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...