All Products
Search
Document Center

SuperApp:Navigation bar

Last Updated:Aug 29, 2024

This topic describes the JavaScript API of WVNavigationBar. You can refer to this topic when you update the visual effect of the navigation bar in a WindVane miniapp.

WVNavigationBar.update

Dynamically configures the navigation bar of the current page.

Input parameters:

  • [string] title: optional. The title of the page.

  • [string] titleColor: optional. The color of the title of the page. The value of this parameter is an RGB color.

  • [string] barStyle: optional. The style of the navigation bar of the miniapp. The value float indicates that the navigation bar floats over the page. The value normal indicates that the navigation bar overlies the page.

  • [string] backgroundColor: optional. The background color of the navigation bar of the page. The value of this parameter is an RGB color.

  • [string] hideBackButton: optional. This parameter indicates whether the return button is hidden. The value true indicates that the return button is hidden. The value false indicate that the return button is displayed. Default value: false.

  • [string] theme: the theme color of the right-side button. Valid values: light and dark. Default value: dark.

Callback parameters:

No callback parameters exist. If the loading message is displayed, the success callback is invoked. Otherwise, the failure callback is invoked.

var params = {
  title: 'Home',
  titleColor: '#FF00FF',
  barStyle: 'float',
  backgroundColor: '#00FFFF',
  hideBackButton: 'false'
};

window.WindVane.call('WVNavigationBar', 'update', params, function(e) {
}, function(e) {
  alert('failure: ' + JSON.stringify(e));
});

WVNavigationBar.getHeight

Queries the height of the navigation bar

Input parameters:

No input parameters exist.

Callback parameters:

  • [int] height: the height of the navigation bar.

  • [int] screenWidth: the screen width.

  • [int] screenHeight: the screen height.

window.WindVane.call('WVNavigationBar', 'getHeight', params, function(e) {
        alert('success:' + JSON.stringify(e));
}, function(e) {
        alert('failure:' + JSON.stringify(e));
});