CESCO
CESCO

Reputation: 7768

How to trigger an ion-item-sliding slide with javascript?

I want to make sure my users know the list, I am presenting them for the first time, is slidable. So I was thinking about randomly sliding one item so my users are aware of that option. How would I trigger that with js or css?

enter image description here

Upvotes: 3

Views: 967

Answers (1)

MikeC
MikeC

Reputation: 461

It seems that these buttons are simply hidden beneath the element they apply to. I noticed on my app, when the hidden button is visible, there is a CSS transform applied to the element.

In my case, the transform applied is -70px. Here is the relevant style:

style="transform: translate3d(-70px, 0px, 0px);"

You would want to experiment to find the appropriate value. I would suggest that you create a special CSS class that you can apply to the element that would force it to apply the transform. Tie the class to a component property. Then, in your code, set that property to true for a brief period of time, and then back to false.

Upvotes: 2

Related Questions