Javascript PhoneGap/Cordova TabBar插件和所选页面
我已经为类似ios的菜单安装了插件TabBar,并且有一种方法可以将所选页面放在应用程序的开头Javascript PhoneGap/Cordova TabBar插件和所选页面,javascript,cordova,uitabbar,Javascript,Cordova,Uitabbar,我已经为类似ios的菜单安装了插件TabBar,并且有一种方法可以将所选页面放在应用程序的开头 plugins.tabBar.selectItem("home"); 问题是,当我更改选项卡时,它总是选择“home”,因此我非常精通javascript,我尝试使用以下代码来解决它: if(document.location.href == "index.html"){ plugins.tabBar.selectItem("home");} 但它不起作用 有人知道解决办法吗? 谢谢大家
plugins.tabBar.selectItem("home");
问题是,当我更改选项卡时,它总是选择“home”,因此我非常精通javascript,我尝试使用以下代码来解决它:
if(document.location.href == "index.html"){
plugins.tabBar.selectItem("home");}
但它不起作用
有人知道解决办法吗?
谢谢大家。我找到了这个
/**
* Function to detect currently selected tab bar item
* @see createItem
* @see showItems
*/
TabBar.prototype.getSelectedItem = function() {
return this.selectedItem;
};
选择选项卡栏项目时,您有哪些操作/回调?
plugins.tabBar.createItem(“home”、“home”、“www/img/53 house.png”、“onSelect:function(){location.href=“index.html”}})