Can someone explain what kind of value the following is actually returning.
I understand the code up until the return part. Isn't it just a bunch of comparisons? What kind of value would come back? It would make sense to me if there was an if statement or something. hopefully my question makes sense.
I am not asking for the actual value being returned but more of the concept behind using the return, thanks.
$.fn.is_on_screen = function(){
var win = $(window);
var viewport = {
left : win.scrollLeft()
};
viewport.right = viewport.left + win.width();
var bounds = this.offset();
bounds.right = bounds.left + this.outerWidth();
return (!(viewport.right < bounds.left || viewport.left > bounds.right));
};
booleanvaluetrueorfalse.... That signifies the method signatureis_on_screen.