Skip to main content
Answered

Is it possible to detect when a Banner is visible with Javascript?

  • 1 February 2021
  • 4 replies
  • 215 views

We're currently using the Banners feature to display product announcements on our homepage. We'd love to be able to use the Inline / Top banner design, but the fixed CSS positioning overlaps our main site navigation, which uses sticky positioning. We instead had to result to using the bottom banner design.

 

Is it possible, using Javascript, to detect when a Banner is being displayed, so we can tweak our navigation style to accommodate the top banner?

 

Not sure if I posted this in the correct category, I didn't see an option for Banners.

Best answer by Brian Matthews

A bit late, but for those looking for a solution….

Have a look at js mutation observers. You can respond to DOM tree changes.

View original
Did this topic help you find an answer to your question?

4 replies

Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • February 4, 2021

Hey @chris g​, we don't currently expose in Javascript if a banner is live.


  • Author
  • New Participant
  • 1 reply
  • February 4, 2021

Thanks @eric f11​ , is it possible to submit a feature request for this?


Eric Fitz
Employee
Forum|alt.badge.img+5
  • Employee
  • 1630 replies
  • February 4, 2021

Of course! We gather product feedback in our @Product Wishlist​ group, which I use as a basis for regular reports to our product team. Don't worry, you won't need to post the feedback separately - it'll show up in the group now because I've tagged the group in my reply!


  • New Participant
  • 1 reply
  • Answer
  • November 15, 2024

A bit late, but for those looking for a solution….

Have a look at js mutation observers. You can respond to DOM tree changes.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings