我正在使用jQuery 2.1.4构建水平可拖动导航。页面加载后,我想偏移元素在可拖动容器内的位置,因此该元素位于视口内。
例如可拖动容器中的位置700的位置:
当前将其设置为0 onload:
// 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>
如何抵消元素在导航位置上的加载?