Multiple page repeaters and code

The following code works on the first displayed page of a repeater, but does not run after a next page button is pushed. What am I missing?
$w.onReady( function () {
$w( “#dataset1” ).onReady( () => {
$w( “#repeater1” ).forEachItem( ($item, itemData, index) => {
if (!itemData.pdf){
$item( “#button10” ).hide();
}
} );
} );
} );