animate widget function