如何在jQuery UI中抵消可拖动元素?

时间:2019-04-19 09:14:37

标签: javascript jquery jquery-ui

我正在使用jQuery 2.1.4构建水平可拖动导航。页面加载后,我想偏移元素在可拖动容器内的位置,因此该元素位于视口内。

例如可拖动容器中的位置700的位置:

enter image description here

当前将其设置为0 onload:

enter image description here

// I tried, but this does not work:

$('nav a').position().left = 500;
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.4/jquery.min.js"></script>
<div class="draggable">
  <nav>
    <a></a>
    <a></a>
  </nav>
</div>

如何抵消元素在导航位置上的加载?

0 个答案:

没有答案