uses mshtml;
var htmldoc: IHTMLDocument2;
MaxScrollWidth, MaxScrollHeight: Integer;
htmldoc := web.Document as IHTMLDocument2;
MaxScrollHeight := htmldoc.body.getAttribute('ScrollHeight', 0); //获得滚动条最大高度
MaxScrollWidth := htmldoc.body.getAttribute('ScrollWidth', 0);//获得滚动条最大宽度
Web.OleObject.Document.ParentWindow.ScrollBy(MaxScrollWidth, MaxScrollHeight ); //滚动到最右最下
var
htmldoc: IHTMLDocument2;
MaxScrollWidth, MaxScrollHeight: Integer;
begin
htmldoc := webbrowser2.Document as IHTMLDocument2;
MaxScrollHeight := htmldoc.body.getAttribute('ScrollHeight', 0); //获得滚动条最大高度
MaxScrollWidth := htmldoc.body.getAttribute('ScrollWidth', 0);//获得滚动条最大宽度
form1.Caption :=IntToStr(MaxScrollHeight)+' '+IntToStr(MaxScrollWidth);
webbrowser2.OleObject.Document.ParentWindow.ScrollTo(0, 1200 ); //滚动到指定位置
webbrowser2.OleObject.Document.ParentWindow.ScrollBy(0, 120 ); //每次跳着滚动120个相素
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请
点击举报。