Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 559
CESCO Avatar asked Mar 28 '26 08:03

CESCO


1 Answers

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.

like image 53
MikeC Avatar answered Mar 29 '26 23:03

MikeC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!