Search code examples
jqueryhidecenter

Make an element "hide" towards its center?


I noticed that when using the hide() function in JQuery, like this:

$("myDiv").hide("slow");

It always "folds" to the top-left corner of the div. Is there a way I could make it fold to the center? (In the case I'm talking about the div is configured "position: absolute;")


Solution

  • jQuery UI has a "scale" effect which might be what you want: http://jqueryui.com/demos/hide/

    http://jsfiddle.net/TzzxZ/1/