well I did this ( code ) - long time ago, but don't have it with me

.
The way I did it:
Create a function, call it on_click.
The function should contain the following.
VAR current_height = you take present value for that element
VAR current_width = same as above
VAR action = 1 or 0 ( 1 - make it bigger, 0 - make it smaller )
Just didn't asked - do you change both width and height, or just one of those ( then the action_height, and achtion_width should be used - separately )
IF ( action == 1 )
{
// Do enlarge the element
}
ELSE IF ( action == 0 )
{
// Do shrink the element
}
You just pass a VARIABLE - by how much do you want to change the dimensions, and as I mentioned above - watch for "500px" instead of just 500 as an integer - as that is what you realy need.