imacros查找滚动条的滚动量 [英] imacros find how much a scrollbar is scrolled

查看:79
本文介绍了imacros查找滚动条的滚动量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

情况:尽管我遇到了很多困难,但我还是试图制作一种可衡量滚动条在特定页面上滚动了多少的微距摄影机:

SITUATION: I am trying to make an imacro that will measure how much a scrollbar is scrolled on a specific page, though I have had various difficulties:

以下javascript代码通常用于此目的:

The following javascript code is often used for this purpose:

var vertical = document.getElementById("myDIV").scrollTop;
alert("amount scrolled vertically: " + vertical);

ATTEMPT#1:

但是,当我尝试在 js 文件的 firefox imacros扩展中使用该代码时,出现以下错误:

However, when I tried using that code in the firefox imacros extension in a js file, I get the following error:

ReferenceError:未定义文档,第1行(错误代码:-991)

产生错误的代码:

var info = document.getElementById("myDIV").scrollTop;
alert("info");

ATTEMPT#2:

所以我接下来尝试的是以下代码:

So what I tried next was the following code:

var info = window.content.document.getElementById("myDIV").scrollTop;
alert("info");

但是会出现以下错误:

错误:多进程Firefox,第208行中不支持访问内容窗口(错误代码:-991)

问题:,我是否可以测量 firefox imacros扩展程序中滚动的数量?如果是这样,怎么办?可悲的是,过去几天我一直坚持这一点.

QUESTION: Is there a way for me to measure the amount scrolled in the firefox imacros extension? And if so, how? I have sadly been stuck on this for the past few days.

推荐答案

您处在正确的轨道上.使用imacros 8.9.7版本.你可以在这里找到它. https://addons.mozilla.org/en -US/firefox/addon/imacros-for-firefox/versions/

You are on the right track. Use imacros 8.9.7 version. You can find it here. https://addons.mozilla.org/en-US/firefox/addon/imacros-for-firefox/versions/

这篇关于imacros查找滚动条的滚动量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆