code clean up; fire events when offset attribute changed.