问题
Just as the title states, is there a jQuery plugin effect that will allow me to hide divs in a way that loos like how Windows does it? So the div would move, shrink, and become transparent to a certain point on the screen. Here is an example: http://fstoke.me/jquery/window/ This is pretty much what I'm looking for except I don't think it's possible to JUST use the effect.
回答1:
You can use jQuery's .animate()
method. What you need for the effect is to change is:
- width of the window
- height of the window
- top position
- left position
like this:
$('#element').animate({
top: $(window).height(), // to force the window to minimize at the bottom corner
left: 0,
width: '20px',
height: 0
});
Here is a jsFiddle example with jQueryUI dialog that I've just made. And this is without jQueryUI.
edit: You can also add transparency if you like to e.g. opacity: 0.3
来源:https://stackoverflow.com/questions/10908419/is-there-a-good-jquery-plugin-for-a-hide-effect-that-looks-like-minimizing-windo