Skip to main content

Premium.utils

Premium.utils.getInView(el, threshold)

ParameterDefinition
eltarget element required
thresholdamount to consider as being in view default: 0.5

Returns true if el is in view. It works for all the panels of scrolling formats ('is','mt', 'fi', 'hi') and the top and centre panels of the Skin. For all other formats it works in a limited way.

var isInView = Premium.utils.getInView(document.querySelector('.element'));