Hi there,
I've put up a basic example of how you would do this at:
http://jsbin.com/ahevu
(to edit the code, go to http://jsbin.com/ahevu/edit)
I've used mouseenter to demonstrate - if you need a hover effect, then
you will need to save the original dimensions/position of the div you
are animating so it can revert to them when the mouseleave event fires.
on 09/01/2010 19:22 Wroathe said::
Hi there! I was curious if there is a way to set up custom animations
so that a div will expand from a specified corner to another specified
corner?
(Ex. If I have a div with a background color of #000 that is 200px by
200px and when I hover over it it expands to 500px by 500px from top
left to bottom right, by default. I want it to expand from top right
to bottom left or bottom right to top left, etc.)
This is how I have it set up (but it only goes from top left to bottom
right)
$('div.item').hover(function() {
$(this).animate(
height: 500px,
width: 500px
);
});