开发者

javascript move image within a div

开发者 https://www.devze.com 2022-12-21 07:12 出处:网络
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 m

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

精彩评论

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