beedesk / jQTouch

jQT + actively maintained + exclusive features (iPad layout, iscroll, tons of css enhancements, page events, param passing between pages, radio button, grid, mail, improved page history management etc.)
http://bit.ly/beedesk-jqt
MIT License
72 stars 13 forks source link

The tabbar dynamic height and hide/show #5

Closed notfair closed 13 years ago

notfair commented 13 years ago

1) Is there a better way to create a dynamic height/position for the tabbar? Like by trigger some function, let said $("a").click(), then it will set the height differently, because I might have some extra container at the below of the toolbar.

currently was use this method to execute the setHeight() function (directly inside the function so only affected once):

if($item.attr('id') != "home"){ <--- if it is not the #home div $cusTab = 0; }else{ $cusTab = 18; } var tabbarH = $cusTab;


2) Another thing is I want to hide the tabbar during the page transition then after the page is finish load, the tabbar only display (let said fade in), currently my code is like this.

    $('div.tabbar').hide();
$('#tabbar').delay(500).fadeIn();
var curDiv = "";
var prevDiv = "";
$('a').click(function(){
    $('div.tabbar').hide();
    if($(this).attr('href') != "#"){    
        curDiv = $(this).attr('href');
        prevDiv = "#" + $(".current").attr('id');
        console.log(prevDiv);   }

    $(curDiv).children('.tabbar').delay(300).fadeIn();
});

$('a.back').click(function(){
    $('div.tabbar').hide();
    $(prevDiv).children('.tabbar').delay(300).fadeIn();
});

The only issue is it can't track very good on the previous page, I know above code got problem, especially in the previous (back) function.

thomasyip commented 13 years ago

Look like you can listen to pageAnimationStart and pageAnimationEnd... example:

          $this.bind('pageAnimationEnd', function(event, info) {
            if (info.direction == 'in') {
              setHeight($(this));
            }
          });
notfair commented 13 years ago

thank :).

Btw, found something wrong in the package, the iScroll.js missing from the package. And also the the swap and cube effect seem like not work very well ;).

thomasyip commented 13 years ago

I think the file has always been in demos\iscroll\iscroll.js

For the effect, some device work better than the other... cube works pretty well on the iphone, even when it doesn't appear right on a browser... not sure there is a solutions for all at once.

notfair commented 13 years ago

but I tested on iPhone simulator, it not work very effectively - -'. But anyway, this is still good.

O ya, I want to ask you, is it possible to make 2 container scroll at the same time? (one vertical & another one is horizontal)?

thomasyip commented 13 years ago

I believe DataZombies tried that with his tabbar.

It is one thing to get it working, it is quite another to get it works well. You might want take a look at how he did it.

notfair commented 13 years ago

alright thank :)