سؤال

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.

هل كانت مفيدة؟

المحلول

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top