I removed the call to the deprecated form of toggle
replacing it with a simple boolean. Also note that padding
should be set like -=150px
instead of =-150px
.
var toggle = true;
$(document).ready(function()
{
$('#hide').click(
function()
{
if(toggle){
$('p').animate({'padding':'+=150px'},3000,'swing');
toggle = false;
}else{
$('p').animate({'padding':'-=150px'},3000,'linear');
toggle = true;
}
}
)
});
Working Example: http://jsfiddle.net/nBzCL/