The main difference between an adverb and a preposition is that a preposition must be followed by a noun (The cat jumped onto the table), and an adverb doesn't - an adverb also modifies a verb (She sang happily), whereas a preposition has to do with nouns.
Having this explanation in mind, the correct answer is adverb.