I have installed the tool bar on ios phone gap. Now I want to add list of item under "More" tool bar. How can I include list on click of "More" tool bar. So on click of "More" the list should popup.
My tool bar event code is as follows,
var tabBar = cordova.require("cordova/plugin/iOSTabBar");
tabBar.init();
tabBar.create({selectedImageTintColorRgba: "255,40,0,255"});
tabBar.createItem("More", "More", "tabButton:More", {
onSelect: function() {
// Here I want to add the list
}
});
tabBar.createItem("About us", "About us", "/www/pixeden-tab-bar-icons-ios-7/line__0000s_0126_info.png", {
onSelect: function() {
aboutus();
}
})
tabBar.show();
tabBar.showItems("About us", "More");
window.addEventListener("resize", function() { tabBar.resize() }, false);
I need to include the list as follows,
<ul>
<li class="newsfeed"><a href="#" title="Home">News Feed</a></li>
<li class="profile"><a href="#" title="Profile">Profile</a></li>
<li class="setting"><a href="#" title="Setting">Setting</a></li>
<li class="logout"><a href="#" title="Logout">Logout</a></li>
<li class="report"><a href="#" title="Report">Report Bug</a></li>
</ul>
The menu bar is the part of a browser or application window, typically at the top left side, that houses drop-down menus that allow the user to interact with the content or application in various ways.
Add, remove, or move a toolbar On the menu bar, choose Tools > Customize. The Customize dialog box opens. On the Toolbar tab, perform one of the following sets of steps: To add a toolbar, choose the New button, specify a name for the toolbar that you want to add, and then choose the OK button.
To display or hide the toolbar, select or clear Toolbar on the View menu. To display or hide the status bar, select or clear Status Bar on the View menu.
You can do something like this:
JavaScript version: - This will work on a phone
Example
Final version
HTML:
<ul>
<li class="newsfeed"><a href="#" title="Home">News Feed</a></li>
<li class="profile"><a href="#" title="Profile">Profile</a></li>
<li class="setting"><a href="#" title="Setting">Setting</a></li>
<li class="logout"><a href="#" title="Logout">Logout</a></li>
<li class="report"><a href="#" title="Report">Report Bug</a></li>
<li class="about"><a href="#" title="About Us">About Us</a>
<ul>
<li><a href='#'>Something</a></li>
<li><a href='#'>Something else</a></li>
</ul>
</li>
</ul>
JavaScript:
var about = document.getElementsByClassName("about")[0];
about.onclick = function()
{
if (this.className == "about clicked")
{
this.className = "about";
}else{
this.className = "about clicked";
}
}
CSS:
ul li{
display:inline;
position:relative;
}
ul li ul{
position:absolute;
display:none;
}
ul li.clicked ul {
display:block;
width:150px;
left:-45px;
}
ul li.clicked ul li{
display:block !important;
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With