HubSpot / messenger

Growl-style alerts and messages for your app. #hubspot-open-source
http://github.hubspot.com/messenger/
MIT License
4.03k stars 408 forks source link

Any examples that work using parentLocations? #115

Open gregveres opened 8 years ago

gregveres commented 8 years ago

I want to use the block style but I want the message to appear directly under the bootstrap nav bar.

I have added a div to the bottom of the nav bar like this: <div id="MessageDiv"></div>

Then when I create the Messenger I use code like this:

    Messenger.options = {
       // extraClasses: "messenger-fixed messenger-on-top",
        theme: "block",
        parentLocations: [".MessageDiv", ".body", ".page"]
    };

should that work? It doesn't or I wouldn't be here. :) And since none of the ParentLocations demos actually bring up a message, I can't tell how they are supposed to work.

Thanks Greg

AvremelM commented 7 years ago

Not sure if this is still an issue for you, but your div has an id of "MessageDiv", but your parentLocations selector is a class: ".MessageDiv" instead of "#MessageDiv".

gregveres commented 7 years ago

Ah good catch. I suspect that was it. I will go back and give that a try. I think I hard coded the amount of space to leave, a dynamic approach is much better.

thanks for pointing that out.