RAZZ Posted May 18, 2006 Share Posted May 18, 2006 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 More sharing options...
scott100 Posted May 18, 2006 Share Posted May 18, 2006 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 More sharing options...
RAZZ Posted May 19, 2006 Author Share Posted May 19, 2006 Hmm, yes. I have actually done that before. I guess I am hoping for a "cleaner" solution.Something like "showPixelsOutOfParent=no", or something.You get my drift Link to comment Share on other sites More sharing options...
Jonas Posted May 19, 2006 Share Posted May 19, 2006 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 More sharing options...
RAZZ Posted May 20, 2006 Author Share Posted May 20, 2006 Ok, then. I guess I will just have to hack my way out of it, using Scott's method. Perhaps swap images in certain situations.Thanks anyways guys! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now