Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在 javascript 中产生效果,当用户访问页面时,透明瓶中的水位从底部的 0 增加到指定的量,例如 800ml。我已经在 flash 中看到了这种效果,但我希望增加的水量可以由我在管理面板中指定
从瓶子的反面图像开始(里面是透明部分),然后在它后面有一个高度可变的元素,其中包含你的背景。
嗯,当然咯。将它放在一个 div 中(您必须以某种方式使其适合瓶子的大小),将其着色为蓝色,然后使用 jQueryanimate()函数之类的东西来扩展高度,从而产生瓶子正在装满的效果。
animate()
如果您希望“增加的高度”是可控的,只需让 jQuery 从您存储管理设置的任何位置拉入所需的高度。