Change negative slice index to follow jQuery