Page 1 of 2

automate event after 3 seconds

Posted: Thu Apr 24, 2014 4:41 pm
by Randy Fahrbach

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 5:22 pm
by Kateryna Grynko

Hi Randy,

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 8:50 pm
by Randy Fahrbach

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 8:52 pm
by Randy Fahrbach

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 9:35 pm
by Alena Prykhodko

You can use this code:

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 9:36 pm
by Alena Prykhodko

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 10:04 pm
by Randy Fahrbach

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 10:08 pm
by Alena Prykhodko

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


automate event after 3 seconds

Posted: Thu Apr 24, 2014 10:08 pm
by Randy Fahrbach

automate event after 3 seconds

Posted: Fri Apr 25, 2014 5:17 am
by Maryna Brodina

Hello!

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