Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to remove arrows on selected popovers #56

Open
markgenest opened this issue Aug 14, 2014 · 0 comments
Open

Option to remove arrows on selected popovers #56

markgenest opened this issue Aug 14, 2014 · 0 comments

Comments

@markgenest
Copy link

It would be nice to include a class or data attribute that you can add to an individual popover to remove the arrow for only that selected popover.

For example, if you wanted to start a stepped tutorial with a modal like intro that isn't linked to a particular element on the page (hence wouldn't need an arrow).

What I did to hack around this was to change the css to hide the highlighted element but show the popover so it seems like the popover isn't tied to any element on the page. However the arrow still appears which ruins the whole effect.

I tried to target the individual popovers through css to solve this, but the problem is that the popovers are generated in the DOM underneath the elements they're appended to, not INSIDE the elements, so I can't target each popover individually through its parent element id or class. Which leaves only a jquery option.

I started by stripping

<div class="arrow"></div>

out of bootstro.js template and then basically adding it in only when a class in called to a certain id.

 $(document).ready(function() {
        elem = $('div#name');
        if (elem.hasClass('add-arrow')) {
            $('.popover').append('<div class="arrow"></div>');
        } 
    });

It seems to work on the element only when the page is first loaded and is the first step. It does not work on subsequent steps or when one goes back to the first step. It appears the bootstro.js is overriding this script except when the page is first loaded. I have placed this script at the bottom of the page for bootstro custom options and not in the bootstro.js itself.

Any ideas on how to modify this or even construct a custom data-attibute that would remove the arrow div? Any help would be greatly appreciated.

Thanks so much!
Mark Genest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant