【发布时间】:2014-11-23 15:27:33
【问题描述】:
我需要将视图滚动到新添加的文本框。
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ScrollTo" + ClientId, "jQuery(function(){$('html, body').delay(2000).animate({ scrollTop: $(document.getElementById(\"" + ClientId + "\")).offset().top },2000);});", true);
但它不起作用。 我在页面资源管理器中没有看到任何错误。
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "ScrollTo" + ClientId, "document.getElementById(\"" + ClientId + "\").scrollIntoView(true);", true);
而且这段代码运行良好,但不是动画滚动。
【问题讨论】:
-
把浏览器给你的错误放上去