Is there a proper method when using jQuery **.show()** to display the element from its center as apposed to the default top/left?
There is a way to accomplish this using the “scale” property of the jQuery UI library, but it seems a bit overkill to rely on that for something so simple. Also I’m aware this can be achieved using a css3 animation + transform scale… but I’m solely interested in a standard jQuery method. If anyone could shed some light on this matter, I would much appreciate it. Thanks!
This reply has been reported for inappropriate content.
Add position absolute to the target element, and set the height/width to be 0 and start animating that up, while repositioning it each time it increases in height/size.
It’s not something that everyone wants to do by default which is why it’s not in the jQuery base library.
Edit: To answer your question. There isn’t a simple way of doing that (since it’s a relatively complex animation) without either writing it yourself or including some library like jQueryUI to do it for you.