在访问者访问的每个网页上叠加一个框架?
因此,我希望能够有一个空间,只需单击一个按钮即可覆盖任何网站上的内容(也位于网页上所有内容之上)。例如,Google 翻译页面 http://translate.google.com/translate?u=about%3Ablank&hl=en&langpair=auto|en&tbb=1&ie=UTF-8< /code> 其中顶部的框架将覆盖在 url 框中输入的任何网站。
我想做的是有一个像这样的框覆盖每个网页,就像谷歌的翻译一样,但通过单击浮动图像(例如箭头)将其隐藏。 这些文件将本地存储在我的硬盘上,但我不认为这是一个问题。
我不知道用什么语言来编码,但我假设是 Javascript,但是,我不知道要调用哪些类来执行此操作。小伙子有什么建议吗?我不是在寻求帮助,只是在寻求正确的方向!
So I want to be able to have a space that overlays content on any website with the click of a button (something that also is above everything on a web page). An example would be the Google Translate page, http://translate.google.com/translate?u=about%3Ablank&hl=en&langpair=auto|en&tbb=1&ie=UTF-8
where the frame at the top will overlay any website that is entered in the url box.
What I want to do is have a box like this overlay every webpage, like google's translate does, but have it hide with a click of a floating image, say an arrow.
The files will be locally stored on my HDD, but I don't see this being an issue.
I don't know what languages to code this in, but I assume Javascript, however, I do not know the classes to call to do this. Any advice chaps? I'm not asking for a hand out, just a point in the right direction!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来您想开发一个浏览器扩展。请在此处查找 Chrome:
http://code.google.com/chrome/extensions/getstarted。 html
对于 IE、FireFox 和 Safari 也有类似的方法。
It looks like you want to develop a browser extension. Look here for Chrome:
http://code.google.com/chrome/extensions/getstarted.html
There are similar ways to do it for IE, FireFox, and Safari.
听起来您需要使用框架或 iframe。尽管它们的实现不同,但它们在与它们交互的方式上非常相似(比如让它们加载新页面)。
w3Schools 是一个学习框架的好网站:
您可以使用JavaScript 通过其名称或 ID 引用框架。例如:document.framename.src = 'hello.php' 或 document.getElementById('frameId').src = 'hello.php'。
使用框架的一个问题是搜索引擎不喜欢它们。如果您使用 iframe,搜索引擎将搜索您的页面,但仍然不会搜索 iframe。
至于调整大小/隐藏框架/iframe,您可以使用框架和 iframe 来完成此操作,尽管完成它的方法根据您使用的内容而有所不同。
It sounds like you'll either need to use frames or an iframe. They are very similar in how you interact with them (say to make them load a new page) although they are different in their implementation.
A great site for learning about frames is w3Schools:
You can use JavaScript to reference the frames via its name or its ID. Ex: document.framename.src = 'hello.php' or document.getElementById('frameId').src = 'hello.php'.
One problem with using frames is that search engines don't like them. If you are using an iframe, the search engine will search your page, but still not the iframe.
As for resizing/hiding the frame/iframe, you can do that with both frames and an iframe, although the method for accomplishing it varies depending on what you use.