Hi roomack -
Your code should work as is. However, you may need to resize your web browser window first and then scroll to your footer. The “viewport” is the area of your web browser that is visible. So technically when you scroll down to the footer, then your #offersnumber “viewportEnter” event should fire.
Another approach that may have more consistent results is:
CODE:
--------
$w.onReady( function () {
//TODO: write your page related code here…
getCounts();
});
function getCounts() {
wixData.query(“Oferty”) //my collection name
.count()
.then( (num) => {
let numberOfItems = num;
$w(“#offersnumber”).text = “” + num; //text field ID placed in footer
} )
. catch ( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
}
Hope this helps.
Will look into getting the other information you asked about (i.e. # of blog posts, forum posts, etc.)
Best,
Nick