简体   繁体   中英

jQuery Mobile navbar navigation

I'm developing my first app using jQuery Mobile and I got a question (didn't find anything in the web). I'm using a navbar with 3 pages.

The first page shows some Wikipedia stuff inside an iframe (keep it in mind)! When I click on the second page (Approfondimenti), it shows a vertical menu with some elements that I can click.

What my jQuery function does (by clicking on one of the menu element in the second page) is to change the iframe 'src' to a new URL... but I don't know how to go back to the first page with my function so my app could show the URL change (don't want manual click on the first page to load iframe content).

Can you help me?

Here is my function:

$(document).on('click', '.a', function(e){ // here i already am in the second page
       var appr=$(this).attr('id'); //here i get the URL from second page, i stored them in the elements id
   $('#iframe').attr('src',appr); //here i set new URL 
       //HERE WHAT TO DO????????
    });

在此处输入图片说明

Add this to change page in jQuery mobile:

 $.mobile.changePage("#page1");

Link: http://jsfiddle.net/androdify/q2LJX/9/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM