3

In an angular application using angular-ui-bootstrap, we have some icons which provide some information to the user:

<i class="icon-info ng-scope" popover="Popovertext goes here" popover-trigger="mouseenter" popover-append-to-body="false" data-original-title="" title=""></i>

I'm using phantomjs to create screenshots of the application, and I need the popover to be visable on the screenshot.

While in the angular-ui documentation there is nothing mentioned about showing a popover programmatically, I found a section in the bootstrap documentation which mentioned the popover method, so I tried:

$('.icon-info').popover('show')

which is not working (but jQuery is available in the application).

How do I open the popover programmatically (from the context of PhantomJS / browser console)?

1

1 Answer 1

4

A simple workaround is to manually trigger the event that is used to show it.

Since you are using jQuery this will be enough in your case:

$('.icon-info').trigger('mouseenter');

Demo: http://plnkr.co/edit/J3hwUXA65orsenL2plbY?p=preview

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.