最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery fill glass effect - Stack Overflow

programmeradmin5浏览0评论

I'm looking for a jQuery or javascript that fill up a glass of water. So when clicking on one button you add water to the glass and when clicking on another you remove water from the glass. Just wonder if someone already have written something like this that I can use.

Thanks!

I'm looking for a jQuery or javascript that fill up a glass of water. So when clicking on one button you add water to the glass and when clicking on another you remove water from the glass. Just wonder if someone already have written something like this that I can use.

Thanks!

Share Improve this question edited Feb 12, 2017 at 20:14 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Dec 17, 2009 at 15:26 MartinMartin 1,65511 gold badges34 silver badges46 bronze badges 2
  • Do you have an example of this? Any images? – Ivan Nevostruev Commented Dec 17, 2009 at 15:31
  • You need to be a bit more specific about the effect. And don't expect someone just to write it for you, try yo build it yourself first and ask if you get stuck. – Tatu Ulmanen Commented Dec 17, 2009 at 15:31
Add a ment  | 

3 Answers 3

Reset to default 6

Create a picture of a water glass with the glass portion transparent.

Put a picture of water behind it.

Animate the image from the bottom to the top. If you want "wavy" water as it fills, make the image have a rippled top, make it slightly larger than the glass, and animate from side to side a little as well.

You may want to look into the slide down and slideup effects in jQuery. You should be able to get what you want out of them.

Link

To create realistic water effects, use the canvas element in A class browsers.

Better, explore john 'jquery' resig's processing.js library. I guess it shouldnt be tough to do what you want with this.

To start you off, http://processingjs/

some examples of processing.js

http://hyper-metrix./processing-js/docs/?page=A%20mouse-driven%20graphic%20equalizer

http://www.mattryall/blog/2008/11/wiki-visualisations-with-javascript#

发布评论

评论列表(0)

  1. 暂无评论