jQuery Mobile 磨砂页眉

标签 jquery css jquery-mobile

我在 jQuery Mobile 中使用固定 header 。我可以使用例如轻松地创建透明 header :

background-color: rgba(255, 255, 255, 0.8);

随着页面向上移动到页眉下方,可以通过页眉看到。

我想要的是模糊通过页眉看到的页面,即“磨砂玻璃”效果。

只是放,例如:

filter:blur(5px);

进入标题,模糊标题中的所有内容,但不会模糊通过标题看到的内容。我不想模糊标题中的内容。

在 jQuery Mobile 中是否有简单的一行代码来获得磨砂玻璃标题?如果它像例如这样简单,那就太好了:

background-color: rgba(255, 255, 255, 0.8), blur(5px);

最佳答案

Demo

CSS

body, html {
    margin: 0;
    padding: 0;
}
header {
    position: relative;
    height: 50px;
    overflow: hidden;
    text-align: center;
}
header:before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,0,0,0.5);
    -webkit-filter: blur(5px);
    z-index: -1;
}

html

<header>this is header</header>

关于jQuery Mobile 磨砂页眉,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31065511/

相关文章:

jquery mobile pageshow事件想要为特定页面工作

javascript - 使用 Google Closure Compiler 编译的 jQuery

javascript - toMatch 不工作

javascript - 单击触发器不适用于 anchor 标记。为什么?

css - Internet Explorer 添加随机高度

jQuery 移动子页面(数据角色 ='page' )不作为正文的直接子页面

javascript - 为什么 XMLHttpRequest 包含 Origin header ?

html - CSS3 列之间的奇怪差距

css - 如何在没有 "jumping"的情况下阻止滚动

javascript - 在 jQuery Mobile data-role=listview 中动态填充 <li>