使网络工具栏加载到任何网页上
我已经用 html 创建了一个工具栏,我需要能够加载任何给定的网页;我正在考虑通过使用小书签将其加载到页面上,但我不太清楚如何去做。
需要发生的事情的示例如下。
我导航到互联网上的任何网页,单击工具栏的书签,它会出现在页面底部,而不会影响页面上的任何内容,即使滚动时它也会保持固定。
我添加了工具栏外观的图片,对于如何实现所需的功能有什么建议吗?
非常感谢
I've created a toolbar in html that I need to be able to load of any given webpage; I'm thinking of loading it on the page through the use of a bookmarklet but I can't quite get my head around how I go about doing it.
An example of what a need to happen is as follows.
I navigate to any webpage on the internet, I click the bookmark for my toolbar and it appears at the bottom of the page without affecting any of the content on the page, it will stay fixed even when scrolling.
I've added a picture of how the toolbar will look, any suggestions on how I can implement the required functionality?
Many Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要做的就是使用 CSS 将其保留在底部。基本上,您将工具栏 html 代码粘贴在
标记中,然后使用 CSS 将其保留在底部。尝试阅读此链接或此链接介绍如何操作
What you will need to do is use CSS to keep it at the bottom. Basically you stick your toolbar html code in a
<div>
tag and then use CSS to keep it at the bottom. Try reading this link or this link on how to do it创建一个可以托管在某处的脚本文件(如果只适合您,则可以使用 localhost)。在该脚本中构建工具栏。您的书签将如下所示:
为了便于阅读,它在此处换行。它不会包含在您的书签中。
javascript:
告诉浏览器您正在执行脚本。末尾的void 0
会阻止页面导航到 JavaScript 的返回值。Create a script file that you can host somewhere (if it's just for you, you can use localhost). In that script build the toolbar. Your bookmarklet will look something like this:
It wraps here for readability. It won't wrap in your bookmarklet.
The
javascript:
tells the browser you are executing a script. Thevoid 0
at the end prevents the page from navigating to the return value of the JavaScript.