Is there a good jQuery plugin for a hide effect that looks like minimizing windows in Windows

走远了吗. 提交于 2020-01-02 10:31:07

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!