jquery - 更改 JQuery Mobile 中可折叠元素的样式

标签 jquery css jquery-mobile

我想更改 JQuery Mobile 中可折叠元素的样式:该元素不应该有任何边框并且是完全白色的。我尝试过以下方法:

 <div class="ui-block-a" data-role="collapsible"  data-collapsed-icon="arrow-r" data-expanded-icon="arrow-d" style="width: 74%; margin-left: 9px; border-width: 0px; background-color:white">
                <h3>Name</h3>
                <p>This is a mock.</p>
            </div>

但是某些 CSS 似乎不起作用。有谁知道是否可行?

最佳答案

这是一个工作示例:http://jsfiddle.net/Gajotres/GNAXT/

它必须通过 css 完成,如果您不想更改每个使用可折叠 css 类的元素,则可折叠元素也必须有自己的 id。

!important 很重要,因为它用于覆盖原始属性。

#custom-collapsible {
    width: 74% !important; 
    margin-left: 9px !important; 
    border-width: 0px !important; 
    background-color: white  !important;
}

#custom-collapsible h3 a {
    border-width: 0px !important; 
    background: white  !important;
}

关于jquery - 更改 JQuery Mobile 中可折叠元素的样式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15342948/

相关文章:

javascript - 响应式 jQuery Mobile 标题按钮

javascript - JQM 自定义选择不动态选择项目

javascript - 网格中的拆分按钮显示在行后面 - Kendo UI

css - Navbar 在 Firefox 和 Chrome 的不同位置使用 anchor 链接和 "position sticky"位置页面

jquery - 单击下拉内容,下拉菜单隐藏

jquery - 我可以通过 webService 调用获取 gridview 的渲染 html 吗?

html - 不透明度在 IE 中不起作用?

jquery-mobile - jquery mobile require.js 和主干

jquery - 使用 jQuery 是否可以包含基于屏幕分辨率的文件?

javascript 的 unload 和 beforeunload 替代方案