Added endReached function

Adds an optional class when the first/last page is reached.