triceam / app-UI

app-UI is a collection of user interface components that may be helpful to web and mobile developers for creating interactive applications using HTML and JavaScript, especially those targeting mobile devices. app-UI is a continual work in progress - it was born out of the necessity to have rich & native-feeling interfaces in HTML/JS experiences, and it works great with PhoneGap applications (http://www.phonegap.com). app-UI can easily be styled/customized using CSS.
http://triceam.github.com/app-UI/
Other
1.27k stars 239 forks source link

Disable Header on Homeview #43

Open wamd-bozem opened 11 years ago

wamd-bozem commented 11 years ago

I was wondering if there is a good solution to hide the header on certain views?

For Example: In my app I have a homescreen where I don't want a header. On all other views I would like to display the header with the back button as usual.

I came up with this somewhat ugly solution:

function pushView(view) {
    window.viewNavigator.pushView( view );

    if(view.title === 'Home')
    {
        jQuery('.viewNavigator_content').css('top', 0)
    }
    else
    {
       jQuery('.viewNavigator_content').css('top', '46px') 
    }    
}

This however requires to also check everytime I press the backbutton etc...

Is there a more elegant solution? Thanks in advance for your help!