您是因为页面刷新了回滚到其实位置了吗。下面的代码如果不设置button的type为button会提交页面刷新
- <button type="button" onclick="setActive()">click</button>
- <script>
- function setActive() {
- var spread = document.getElementById("<%=FpSpread1.ClientID %>");
- spread.SetActiveCell(40, 1);
- }
- </script>
复制代码 |