Randy Fahrbach
Posts: 0
Joined: Fri Oct 25, 2013 2:12 pm

automate event after 3 seconds

I would like my first graphic landing page to automatically navigate to the next page after three seconds.

Right now I have the event set on a click. There is the first landing page on my app

http://appery.io/app/mobile-frame?src...

Is there a way to accomplish this?

Thanks,

Randy

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

automate event after 3 seconds

Hi Randy,

You can use setTimeout: https://developer.mozilla.org/en-US/d...

Randy Fahrbach
Posts: 0
Joined: Fri Oct 25, 2013 2:12 pm

automate event after 3 seconds

Sorry, Katya,...I'm not much of a programmer and couldn't figure out which code on the page to use and then how to customize it for my needs. It did give me a clue....I tried this below....but it didn't work. Am I close?

window.onload = function() {
var counter = 3;
var interval = setInterval(function() {
counter--;
$("3").text(counter);
if (counter === 0) {
redirect();
clearInterval(interval);
}
}, 3000);

};

function redirect() {
site_menu.submit();
}

This was the code on the page you suggested. I don;t know how to change it to navigate to the site_menu instead creating a text pop-up

var timeoutID;

function delayedAlert() {
timeoutID = window.setTimeout(slowAlert, 2000);
}

function slowAlert() {
alert("That was really slow!");
}

function clearAlert() {
window.clearTimeout(timeoutID);
}

Any help you can provide is appreciated.

Thanks,

Randy

Randy Fahrbach
Posts: 0
Joined: Fri Oct 25, 2013 2:12 pm

automate event after 3 seconds

Also....what is the event to key the action off of? There is no "page load" event.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

automate event after 3 seconds

You can use this code:

presetTimeout(function () {
Appery.navigateTo('Page_name', {transition : 'slideup'});
}, 10000);/pre

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

automate event after 3 seconds

It's called Load event docs.appery.io/documentation/working-with-events-and-actions/#jQuery_Mobile_events

Randy Fahrbach
Posts: 0
Joined: Fri Oct 25, 2013 2:12 pm

automate event after 3 seconds

I do not have "Load" as an option in my events drop down. How can I add this?

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

automate event after 3 seconds

Previous link http://docs.appery.io/documentation/w...
Ensure you choose Screen as component.

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

automate event after 3 seconds

Hello!

According to Alena's comment you have to select screen instead Image
Image

Return to “Issues”