简体   繁体   English

未知网站上的较高z-Index

[英]Higher z-Index on an unknown website

I am trying to make a nice UI for a userscript i did to enhance the Moodle at my school. 我正在尝试为我用来增强学校Moodle的用户脚本创建一个不错的UI。

I need to make a progressbar at the top of the browser viewport, so wherever the user scrolls, it will always be visible. 我需要在浏览器视口的顶部创建一个进度条,因此无论用户滚动到哪里,它始终是可见的。

I know it has to have position:fixed; 我知道它必须有position:fixed; but i can't deal with z-Indexes. 但我无法处理z-Indexes。 I tried everything that came to my mind, from maximum z-Indexes, to appending on body, on document, ..., but no luck. 我尝试了所有想到的方法,从最大的z索引,到附加到正文,文档,...,但是没有运气。

This is the code i have now (a bit messy. i am adding html using jquery so...): 这是我现在拥有的代码(有点混乱。我正在使用jquery添加html等等):

$("#page-header").append($("<div id='progress_container' style='background-color:black;position:fixed;'><div id='progress' style='height:15px;background-color:green;width:0%;'></div></div>"));

A little bit more beautiful, (im appending this to $("#page-header") ): 更漂亮一点(将其附加到$("#page-header") ):

<div id='progress_container' style='background-color:black; position:fixed; top: 0px; left: 0px;'>
    <div id='progress' style='height:15px; background-color:green; width:0%;'></div>
</div>

Still messy. 仍然凌乱。

I just need it to be on top of everything. 我只需要它位于一切之上。

The question is, is there any way to override z-Indexes, or to know the highest one on a page to put mine even higher, is what i am trying to do possible? 问题是,是否有任何方法可以覆盖z-Indexes,或者知道页面上的最高索引以使我的索引更高,我正在尝试做些什么?

它不可见,因为它的宽度为零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM