Page 1 of 1

Slide right for nex and left for back with random javascript list!?

Posted: Wed Nov 05, 2014 8:46 pm
by antonback89

Hey!

I guess this is a impossible thing to do because i use the random function with my javascript.
But i have a app with a list javascript-list and when you press the screen a random question shows.

Now i'm wondering if there is a way to go back to the question before with some kind of back button or gesture?
I understand that this maybe wont work since it shows randomely questions.

But i just have to ask =)

Thanks!


Slide right for nex and left for back with random javascript list!?

Posted: Wed Nov 05, 2014 9:35 pm
by Maryna Brodina

Hello!

I am sorry, not sure I understand :)

Could you be more specific and describe the problem step by step?


Slide right for nex and left for back with random javascript list!?

Posted: Sat Nov 08, 2014 7:47 pm
by antonback89

Oh sorry for my bad english!
I mean if its possible to create a "Back-button" that shows the previous question even if i tell my "Next-button" to pick a random question from my javascript list?


Slide right for nex and left for back with random javascript list!?

Posted: Sun Nov 09, 2014 11:33 pm
by Illya Stepanov

Hi Anton --

You can save the displayed question in a local storage and implement the needed logic for your 'Back button'.


Slide right for nex and left for back with random javascript list!?

Posted: Mon Nov 10, 2014 7:53 pm
by antonback89

really?
Do you have a chance to tell me more about it?
Or is it a complicated thing to do?


Slide right for nex and left for back with random javascript list!?

Posted: Tue Nov 11, 2014 3:29 am
by Yurii Orishchuk

Hi Anton,

It's easy to use following JS code:

pre

$.mobile.back();

/pre

Given code will navigate to previous JQM page.

But you if you use on the page some specific logic (like show different content each time you visit this page) you need to implement store previous showed items to restore them when back to this page again.

Regards