Nicklas
Posts: 0
Joined: Thu Jul 03, 2014 8:51 am

Open a popup only one time!

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

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Open a popup only one time!

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

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Open a popup only one time!

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'
});
}

She
Posts: 0
Joined: Wed Oct 08, 2014 12:46 am

Open a popup only one time!

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

Return to “Issues”