如何从richfaces组件中删除css类? [英] How can I remove the css classes from a richfaces component?

查看:72
本文介绍了如何从richfaces组件中删除css类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 rich:simpleTogglePanel 并将这3个css类放在div上:

I'm using a rich:simpleTogglePanel and it puts these 3 css classes on the divs:

rich-stglpanel
rich-stglpanel-header
rich-stglpnl-marker
rich-stglpanel-body

有什么方法可以删除这些类吗?

Is there any way that I can remove those classes?

推荐答案

每个Richfaces组件都带有一组CSS类。这些CSS类用于自定义切换面板(或任何其他RF组件)的方面。四个CSS类,如组件指南中所述,确实附加到RF框架生成的HTML组件。

Every Richfaces component comes with a set of CSS classes. These CSS classes are used to customize the aspect of your toggle panel (or any other RF component). The four CSS classes, as explained in the component guide, are indeed attached to the HTML components generated by the RF framework.

有两种解决方案:


  1. 自定义CSS以扩展四个CSS类的默认属性。这样,您将拥有此组件所需的渲染。

  2. 使用JavaScript删除CSS类(不推荐)。

使用一些jQuery脚本可以轻松实现第二个解决方案:

The second solution can be achieved easily with some jQuery script:

jQuery(document).ready(function() {
    jQuery(".rich-stglpanel").removeClass("rich-stglpanel");
    ...
});

(这意味着加载页面后,找到所有带CSS类的元素 rich-stglpanel 并删除此类)。

这篇关于如何从richfaces组件中删除css类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆