problem is in your jquery.each block.
"return true" inside jquery.each block will not return but continue for next items. Also, this will not return from your determineContent function, so the next code for scroll will also be executed and determineContent will always return false.
use a flag e.g.
var found = false;
JQuery.each(function(){
if(found) return;
//if your condition is true then found = true
})
if(found) return true;
//else continue the next line.