Page 1 of 1

Unique page selector jQuery

Posted: Tue May 27, 2014 7:47 am
by anon

I am trying to execute a piece of jQuery on a particular page in Appery. It is a little bit of logic to toggle the visibility of the footer depending on which way the user scrolls (like facebook's filtering footer navbar)

However, the logic is working on other pages than specified in the load event. (I only want this to work on the page I defined it in on Load).

How do I fix this?

Code:

$(window).on({
scrollstop: function() {
var st = $(this).scrollTop();
if (st = windowHeight){
Appery('mobilefooter').hide();
} else {
Appery('mobilefooter').show();
}
windowHeight = st;
cache.windowHeight = st;
}
});

Is there a way to target the specific window? $(this)?


Unique page selector jQuery

Posted: Tue May 27, 2014 9:10 am
by Kateryna Grynko

Hi,

'window' is a browser window variable that can't be defined for a specific page. You can add a check to this handler to see whether the page is active:preif( Apperyio("screenName").is(':visible')){
alert("visible");
}/pre


Unique page selector jQuery

Posted: Sat May 31, 2014 1:01 am
by anon

$(window).on({
if( Apperyio("screenName").is(':visible')){
scrollstop: function() {
var st = $(this).scrollTop();
if (st = windowHeight){
Appery('mobilefooter').hide();
} else {
Appery('mobilefooter').show();
}
windowHeight = st;
cache.windowHeight = st;
}
}
});

Did the trick thanks