# Trigger for when whole object is visible

**URL:** <https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690>\
**Category:** How-to Discussions\
**Created:** [July 5, 2017, 3:07pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690 "2017-07-05T15:07:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zia\_Karim](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zia\_Karim](https://forums.fusetools.com/u/Zia_Karim)\
**Post date:** [July 5, 2017, 3:07pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/1 "2017-07-05T15:07:50Z")

</div>

Hello,  
I’m using the `WhileVisibleInScrollView` tag to trigger some animations. However, I want to make it so that the trigger activates when the entire object is visible in the `ScrollView`, right now the animation is triggered when any part of the object is visible in the `ScrollView`. Is this possible?

Thanks

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 5, 2017, 3:47pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/2 "2017-07-05T15:47:37Z")

</div>

Hi,

the `Distance` property allows a bit of customisation, but seems that it won’t do exactly what you’re after. I suggest you take a look at [WhileVisibleInScrollView](https://github.com/fusetools/fuselibs-public/blob/master/Source/Fuse.Controls.ScrollView/Triggers/WhileVisibleInScrollView.uno) implementation, and build a similar trigger that takes into account the height of the particular element.

Hope this helps!

---

<div class="post-metadata">

**Author:** ![Zia\_Karim](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zia\_Karim](https://forums.fusetools.com/u/Zia_Karim)\
**Post date:** [July 5, 2017, 6:55pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/3 "2017-07-05T18:55:49Z")

</div>

I see, are you suggesting that I build something similar to `WhileVisibleInScrollView` in Uno? Can you point me in the direction of a how-to or tutorial that can show me how to do this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 5, 2017, 10:39pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/4 "2017-07-05T22:39:50Z")

</div>

Yes, that is exactly what I’m suggesting. Either building a new trigger, or extending `WhileVisibleInScrollView` so that it does what you need it to do.

The [Native Interop](https://www.fusetools.com/docs/native-interop/native-interop) section and its subsections should get you started. Looking at the existing code in `fuselibs-public` will help a lot too; I’m fairly certain there are other triggers that access the dimensions of a visual.

---

<div class="post-metadata">

**Author:** ![Uldis](https://yyz1.discourse-cdn.com/flex035/user_avatar/forums.fusetools.com/uldis/32/657_2.png) [@Uldis](https://forums.fusetools.com/u/Uldis)\
**Post date:** [July 12, 2017, 8:36am UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/5 "2017-07-12T08:36:15Z")

</div>

Hi Zia,

good news! We have now implemented a `Mode` property on `WhileVisibleInScrollView` that can be either `Partial` (default) which works just as it did before, and `Full` which works as you would expect it to.

This has been merged to fuselibs-public/master now, so you can get it with a local checkout of fuselibs: [https://github.com/fusetools/fuselibs-public/pull/178](https://github.com/fusetools/fuselibs-public/pull/178)

There are no details on which future release of Fuse will have this in the libs bundled with the installer, so if you need it, I suggest you get that local checkout working.

---

<div class="post-metadata">

**Author:** ![Zia\_Karim](https://avatars.discourse-cdn.com/v4/letter/z/9d8465/32.png) [@Zia\_Karim](https://forums.fusetools.com/u/Zia_Karim)\
**Post date:** [July 24, 2017, 10:20pm UTC](https://forums.fusetools.com/t/trigger-for-when-whole-object-is-visible/4690/6 "2017-07-24T22:20:43Z")

</div>

Amazing, thank you so much. I will have a play around.
