Is there any way to make an animation in Jquery which is bei开发者_JAVA技巧ng used by Mac OS while minimizing and maximizing the screens?
What you're looking for is a "genie effect" and that is not really possible/practical using JavaScript or jQuery. Perhaps when canvas gets further along in HTML5 this can be ported over to make it happen. In Flash this is possible as it is within other scripting languages that have higher bitmap manipulation capabilities.
Also, there are other questions like this on Stack Overflow with links off to Flash examples of the effect: Genie animation Javascript?
I'm pretty sure that doesn't exist or at least you can't be sure that the user is minimizing the window.
What you can do, is to check is the user focus on your page or not, and depending on that state you can play your animation.
Check out https://github.com/kamilkp/geniejs
and http://kamilkp.github.io/ for demo.
It works in every browser including mobile (not always smoothly on firefox though). It supports Genie Effect transitions in every direction (top, bottom, left, right). It works even if the target html element is a child of some container that has overflow auto or hidden. It is library agnostic itself, but i also wrote a convenience jQuery plugin. And if you also include the html2canvas library in your project, the plugin lets you animate HTML elements with genie effect (expanding example here: http://kamilkp.co.nf/genie/canvas/)
The only requirement for the browser is that it needs to support CSS transitions. It's a pure javascript + CSS solution.
精彩评论