Tab Bar Navigation Issue - Please Help!

3 views
Skip to first unread message

Lou Herman

unread,
Oct 23, 2009, 2:04:47 PM10/23/09
to liqui...@googlegroups.com
Hello,

If someone can help me, I would greatly appreciate it.

Ok, I managed to get the Tabbar working in the latest SVN download. I am working in the function call for one of the buttons. The problem is, I cant figure out how to open a DIV within the index.html file or bring a separate html file into the view. Here is my code:




lg.bind('lg_init_jqtouch', initTabs);

function initTabs() {

      

        lg.tabs.add({btn:1, title:'Home', icon:'btn1.png', callback:'onTabClick1()'});

        lg.tabs.add({btn:2, title:'Files', icon:'btn2.png', callback:'onTabClick2()'});

        lg.tabs.add({btn:3, title:'Favorites', icon:'btn3.png', callback:'onTabClick3()'});

        lg.tabs.add({btn:4, title:'Phone', icon:'btn1.png', callback:'onTabClick4()'});

        lg.tabs.add({btn:5, title:'About', icon:'btn2.png', callback:'onTabClick5()'});

        lg.tabs.show();
       
       

}

 

function onTabClick1() {

lg.page.open('music'); // this is a DIV ID on the index page.

           

           
}




Thanks,
Lou


Skip Potter

unread,
Oct 23, 2009, 4:12:52 PM10/23/09
to liqui...@googlegroups.com
Does the DIV have a title with a # sign in it? I think that jumping
to an internal section of a web page you use something like "#magic".

Skip

Lou Herman

unread,
Oct 24, 2009, 10:54:30 PM10/24/09
to liqui...@googlegroups.com
I actually just used a little JQuery inside the function to call a "A Link" and that did the trick. The TabBar works perfect now.. here is the code:

** also note that you need to turn on the TABBAR funcitonality in the Config file in the Config folder in the LG Xcode project.




lg.bind('lg_init_jqtouch', initTabs);

function initTabs() {

      

        lg.tabs.add({btn:1, title:'Home', icon:'btn1.png', callback:'onTabClick1()'});

        lg.tabs.add({btn:2, title:'Files', icon:'btn2.png', callback:'onTabClick2()'});

        lg.tabs.add({btn:3, title:'Favorites', icon:'btn3.png', callback:'onTabClick3()'});

        lg.tabs.add({btn:4, title:'Phone', icon:'btn1.png', callback:'onTabClick4()'});

        lg.tabs.add({btn:5, title:'About', icon:'btn2.png', callback:'onTabClick5()'});

        lg.tabs.show();
       
       

}

 

function onTabClick1() {

//this is reference to simple <A href> tag on the index file which triggers the new screen to come into view.

$("#button1").click();
         
}



Here is the link, I put a simple ID on the A tag to call it;


<ul >
        <li><a id="button1" href="#home"></a></li>
</ul>


Hope this helps!

Thanks,
Lou
--
Thanks,
Lou Herman
Reply all
Reply to author
Forward
0 new messages