javascript move image within a div
i have a div and and a looping move function that translates an image by 1px within the div. The width of the div is 400px; the image starts moving from right to left, but I can't figure out how to make it start appearing from behind the div border. Currently if I set a starting x-position at 405px and finishing x-position at -5 the image simply starts moving in front of the div. How do I make it so when it starts moving at 405 but only becomes visible once it crosses the div border at 400px?
th开发者_JAVA技巧anks
Use overflow: hidden;
on the div and give it a width of 400px.
精彩评论