如果我单击活动菜单项的左侧,例如:1,2菜单项,我想添加“ uk-animation-slide-left-small”类,否则添加“ uk-animation-slide-right-small”类单击活动菜单项的右侧,例如:4,5菜单项。没有jQuery。
<script src="https://getuikit.com/assets/uikit/dist/js/uikit.js"></script>
<link href="https://getuikit.com/assets/uikit/dist/css/uikit.css" rel="stylesheet"/>
<ul class="uk-subnav uk-subnav-pill" uk-switcher="animation: uk-animation-slide-right-small">
<li><a href="#">Item1</a></li>
<li><a href="#">Item2</a></li>
<li class="uk-active"><a href="#">Main</a></li>
<li><a href="#">Item4</a></li>
<li><a href="#">Item5</a></li>
</ul>
<ul class="uk-switcher uk-margin">
<li>Content1</li>
<li>Content2</li>
<li>Content3</li>
<li>Content4</li>
<li>Content5</li>
</ul>
我要重新创建https://getuikit.com/v2/docs/switcher.html#switcher-animations->滑动水平效果