Page 1 of 1

Open a popup only one time!

Posted: Tue Apr 14, 2015 11:49 pm
by Nicklas

Hello!
Can anyone give me a code for how I can show a popup only the first time a user of my app opens the app?

My first screen is called: Menu
The popup is called: pop1


Open a popup only one time!

Posted: Wed Apr 15, 2015 12:55 am
by She

Hi Nicklass,

try to store a value inside the localstorage, if that localStorage dont have any value the popup will show and if the localstorage has a value the popup will show.
better to use if statement in pageshow or load event of the page.

Goodluck


Open a popup only one time!

Posted: Wed Apr 15, 2015 2:07 am
by She

put this on pageshow event of Menu:

var popUPValue = localStorage.getItem("_ValpopUp");

if(popUPValue == ""){
//change "popup" to the name of your popup
Appery.navigateTo('popup', {
transition: 'none'
});
}


Open a popup only one time!

Posted: Wed Apr 15, 2015 2:20 am
by She

Hi Nicklass,

put this on Load event of Menu:

var popUPValue = localStorage.getItem("_ValpopUp");

if(popUPValue == ""){
//change "SamplePopUP" to the name of your popup
Appery( "SamplePopUP" ).popup( "open", {transition:"slideup"} )
}

//then on your popup add button and add this jscript:
localStorage.setItem("_ValpopUP","opened");
Appery("SamplePopUP").popup("close");

Goodluck