jquery - ZIndex Windows 移动版

标签 jquery html css html5-video z-index

我的搜索框在 windows mobile 中的视频标签的 z-index 有问题

<div portal:substituteby='common/search::search'></div>

应该在视频上

                        <a th:if="${hrefCinemagraph}!='#'" th:href="${hrefCinemagraph}" th:target="${targetCinemagraph}" class="center">
                            <div>
                                <div class="navigation"></div>
                                <img the:src="@{${imageCinemagraph}}" alt="Ofertas de viajes" title="Ofertas de viajes"/>
                            </div>
                        </a>

但在 Windows Mobile 中,如果我使用 z-index 属性,则不可能让它看起来像这样,视频总是在顶部。

两个元素(div 和 href)在它们的 css 中都有绝对位置。

我尝试在页面加载后使用 jquery 设置属性,但它也不起作用:

    setTimeout(
              function() 
              {
                    $(document).ready(function(){
                        $('#video').css("-webkit-transform-style","preserve-3d");
                        $('#video').css("z-index",1);
                        $('#video').css("position","absolute");
                        $('#buscador').css("position","absolute");
                        $('#buscador').css("z-index",1000000);
                        alert("video z index is " + $('#video').zIndex());
                        alert("buscador z index is " + $('#buscador').zIndex());
                    });
              }, 5000);  

我的代码:

                <div class="gallery">
                    <section>
                        <div portal:substituteby='common/search::search'></div>
                        <a th:if="${hrefCinemagraph}!='#'" th:href="${hrefCinemagraph}" th:target="${targetCinemagraph}" class="center">
                            <div>
                                <div class="navigation"></div>
                                <img the:src="@{${imageCinemagraph}}" alt="Ofertas de viajes" title="Ofertas de viajes"/>
                            </div>
                        </a>
                        <div th:if="${hrefCinemagraph}=='#'" class="center">
                            <div class="navigation"></div>
                            <img the:src="@{${imageCinemagraph}}" alt="Ofertas de viajes" title="Ofertas de viajes" />
                        </div>
                        <div class="right"></div>
                    </section>
                </div>

我花了一整天的时间来修复它。

最佳答案

在纠结了这么多次之后,我们最终决定在移动设备中隐藏 video 标签,以防止 video 标签和 windows phone 中的 z-index 出现问题。

关于jquery - ZIndex Windows 移动版,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25974090/

相关文章:

jquery - $(document).ready(function() - 不起作用

javascript - 我如何从多个链接调用相同的 fancybox javascript?

php - 在 PHP 中输​​出 jQuery,引号问题

javascript - 如何使用 jquery/ajax 访问响应头

javascript - 显示和隐藏 jQuery 选项卡

javascript - 旋转图像并使文本稍后出现在图像上

javascript - 使用带有 HTML 和 CSS 的图像链接时,如何在悬停时在不同位置显示图像

html - 有没有办法在 float 元素上设置 CSS 最小宽度?

css - Flexbox:我的 div 没有全高

css - Angular 2 : How to style host element of the component?