开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜