antonback89
Posts: 0
Joined: Mon Apr 14, 2014 7:17 pm

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

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!

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

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

Hello!

I am sorry, not sure I understand :)

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

antonback89
Posts: 0
Joined: Mon Apr 14, 2014 7:17 pm

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

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?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

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

Hi Anton --

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

antonback89
Posts: 0
Joined: Mon Apr 14, 2014 7:17 pm

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

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

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

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

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

Return to “Issues”