Notice: The Monaca & Onsen UI Community Forum is shutting down.

For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.

Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.

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 defined

    Please help
    showPopover is not defined


  • Onsen UI

    @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.