[英]Move image inside a div?
I have a div with a specific width and height. 我有一个具有特定宽度和高度的div。 And a smaller image with the same width but much less height. 较小的图像具有相同的宽度,但高度却少得多。 How could I 我怎么能
- Position the small image to the inside top of the big div (but still all the small image to be visible in it) 将小图片定位到大div的内部顶部(但仍然要在其中看到所有小图片)
- Animate the small image from the inside top of the big div to the inside bottom (and again, still keep it all visible) 从大div的内部顶部到内部的底部对小图像进行动画处理(再次使所有图像保持可见)
- Inverse the process to go to the top again 逆过程再回到顶部
I 've been totally confused with this one. 我对此完全感到困惑。 All widths/heights are known, so they don't need to be calculated dynamically. 所有宽度/高度都是已知的,因此不需要动态计算。
Thank you. 谢谢。
You can see an example of the code here 您可以在此处查看代码示例
In general look at the .animate()
method of jQuery. 通常来看一下jQuery的.animate()
方法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.