popover in navigation
-
<ons-icon icon=“ion-android-more-vertical” onclick=“showPopover(this)”></ons-icon>
<ons-popover direction=“up” id=“popover”>
<div style=“padding: 10px; text-align: center;”>
<p>
This is a popover
</p>
<p>
<ons-button onclick=“hidePopover()”>Close</ons-button>
</p>
</div>
</ons-popover>JS :
var showPopover = function(target) {
document
.getElementById(‘popover’)
.show(target);
};var hidePopover = function() {
document
.getElementById(‘popover’)
.hide();
};I am trying to add popover in navigation but getting error
Uncaught ReferenceError: showPopover is not definedPlease help
showPopover is not defined
-
@shweta Seems like your script is not connected to the HTML. Are you including it correctly?
-
@misterjunio said:
including
yes i m including it my main js only. When i hit this js code in console i got same error.