# Comment détecter un changement de visibilité dans un widget ?

**URL:** <https://meta.discourse.org/t/how-to-detect-visibility-change-in-widget/115951>\
**Category:** Product Support\
**Created:** [Avril 25, 2019, 11:24 UTC](https://meta.discourse.org/t/how-to-detect-visibility-change-in-widget/115951 "2019-04-25T11:24:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![bartv](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/bartv/32/130052_2.png) [@bartv](https://meta.discourse.org/u/bartv)\
**Post date:** [Avril 26, 2019, 8:18 UTC](https://meta.discourse.org/t/how-to-detect-visibility-change-in-widget/115951/3 "2019-04-26T08:18:19Z")

</div>

Ah! I was already using that, but your comment made me re-examine this mechanism and it now works correctly. You can test on [blenderartists.org](http://blenderartists.org) if you like. I’m using an asynchronous job to load the json and render the HTML. This is cached in the browser and then inserted into the menu whenever needed. I refresh the cached data every 5 minutes to update the ‘notification count’ on the news menu as needed.

The code is still not my finest, but once I’ve cleaned it up I’m happy to share it if anyone is interested.

---

_[View the full topic](https://meta.discourse.org/t/how-to-detect-visibility-change-in-widget/115951)._
