So you can do it like: --- mainView.loadPage({url:'....', animatePages:false, reload: true});
So I tried with this and it´s not working, I feel like I miss something else, or? var mainView = myApp.addView('.view-main', { url: 'page1.html' }); mainView.reloadPage({url: 'page1.html', animatePages: false}); I
ok I will try, thanks
so I tested with this and it is not loading it var mainView = myApp.addView('.view-main', { //url: 'page1.html' }); mainView.loadPage({url:'page1.html', animatePages:false, reload: true}); and my index: <!-- Your first view, it is also a .tab and should have "active" class to make it visible by default--> <div id="view-1" class="view view-main tab active"> </div>
Your View HTML layout is not full, it also should contain .pages and .page containers, refer to docs http://www.idangero.us/framework7/docs/app-layout.html#.VCAxWJN_tyo
ok, thanks, but it is still not loading the page1.html page? It is displaying the text from the index page? I thought that since you have .pages and .page in the page1.html it was not needed in the index page.
I don't know if you have the time, but if you look at the bottom of the text here http://www.manmade.se/iphone/matappen/tabbar/ it is from the index file.
I have to leave now, will have to look at this tomorrow. thanks again
Ok, i see, you need to upgrade F7 to latest 0.9.6 version where this methods are available
ok, thanks I didn't realize that I had an old version, will test tomorrow, thanks a lot!
Hi, ok, so now I got it working :-) Have a look and see what you think!? It works great, you have done a really good job and I really appreciate it! Just one more question? I would like to hide the toolbar at the bottom when I start to scroll up and make it visible when I scroll down again. Do you have any suggestions about that? I will check in the docs and see if I find anything, but a pointer is always appreciated, thanks again! Claes
There is no such feature to hide navbar/toolbar on scroll, but you can try to implement it by your self. Here some kind of solution http://www.idangero.us/framework7/forum/#!/feature-requests:hiding-navbar
ok, thanks will look at the link. But can I detect the scroll up and scroll down in a page?
It is done in provided example
Hi, thanks it works to hide the navbar in the mainView, but I don´t know how to hide the the toolbar since it is not inside the mainView? It´s inside the .views div. Any thoughts? With the var mainView = myApp.addView('.view-main'); you control the mainView, but how do I get control over the main wrapper the .views div? var wrapperView = myApp.View('.views'); Well it´s not working, but some thing like it? I hope you understand what I mean :-) Thanks!!
Does the toolbar has to be inside the mainview for mainView.hideToolbar(); to work? I guess it has, but is there a global one instead, something like - Views.hide.Toolbar(); I don´t think it is, but just wanted to ask. I just simple want to hide the toolbar when scrolling up, regardless of what view is loaded(I have 4), thanks again.
Ok I have tested all I can think of but no luck! I also tried to hide the navbar(as a test) in the second view - view2 - but I can´t get this working! I put it in a function that I call when I display the view2 by clicking on the toolbar icon onclick="laodView2();". loadView2(); $(document).load('pageInit', function(e){ loadView2(); }) function loadView2() { //alert("this is view2"); var previousScrollPosition = 0; view2.showNavbar(); $$('.page-content').on('scroll', function (e) { var pageContent = this; var pageScroll = pageContent.scrollTop; if (pageScroll > 44) { if (pageScroll > previousScrollPosition) { view2.hideNavbar(); } else { view2.showNavbar(); } // Comment out if we do not need to show them on the end of scroll if (pageScroll >= pageContent.scrollHeight - pageContent.offsetHeight - 44) { view2.showNavbar(); } } else { view2.showNavbar(); } var scrollDiff = Math.abs(previousScrollPosition - pageScroll); if (previousScrollPosition > pageScroll) previousScrollPosition = pageScroll; else { if (scrollDiff > 20) previousScrollPosition = pageScroll; } }); } It displays the alert but the code is not working!? When I use it for the mainView it works.
So to hide tabbar that is not inside of View you may just use: --- $('.views').addClass('hidden-toolbar')
About hide/show it on scroll can't say much now, as no currently much time to hook into this part of custom code
Great, your the man :-) I´ll test and see. Thanks!