It is invalid to set a dynamic ceiling in a node in a sliding plug-in such as swiper.

I used the swiper plug-in, and then there is a nav-title toggle bar node in the dome tree. Now the requirement is to float the toggle bar to the top when it is pulled up to a certain distance.
my implementation is to set two styles for nav-title. When the ceiling event is not triggered, it is the default style, and when it is triggered, it is changed to the top style:

//
fixd{
    position: fixed;
    top: 0;
   }

the logic is not complicated, but during debugging, we found that although the fixd style class was successfully added, the node still followed the dome tree to the outside of the screen.
I actually solved this problem before: using two identical nodes, one sucking top, hidden by default, and the other as the initial node, according to the default style. Then toggle the display and hiding of the two elements by triggering the ceiling event. But this can only be regarded as a way of trickery, and it does not solve the problem at all.
ask this question again, hoping that some great god can give us some advice

Mar.06,2021
Menu