更改LightBox Primefaces的样式边框

时间:2011-11-02 08:54:45

标签: css jsf primefaces

我使用PrimeFaces 1.1和JSF 1.2。 我需要将具有黑色边框的PrimeFaces <p:lightBox>叠加层的样式更改为蓝色,但组件的style属性不会更改叠加层,而只会更改灯箱所用的链接调用。

<p:lightBox width="50%" height="25%" 
    style="border: 5px; border-style: solid; border-color: blue;">
    <h:outputLink value="#" title="Leo Messi" >
        <h:outputText value="The Messiah"/>
    </h:outputLink>

    <f:facet name="inline">
        <h:panelGrid columns="2">
            <p:graphicImage value="/images/barca/messi.jpg" />
            <h:outputText style="color:#FFFFFF"
                value="Messi is an unusual player. He is highly creative, and has the skills to take on defenders with ease. He is a versatile left-footed player who can play either in the middle or on either wing, or even as a centre forward.
                Although he is quite short, he is so fast and physically strong that he can cope with larger opponents. He is incredibly powerful, and a specialist in such dead ball situations as corners, free kicks and penalties.
                Leo Messi is cool-headed and able to assume several responsibilities in times of need. He is a player who is destined to have a very successful career in football."></h:outputText>
        </h:panelGrid>
    </f:facet>
</p:lightBox>

1 个答案:

答案 0 :(得分:0)

如果我没错,则生成<a>标记。我不知道您是否可以向灯箱<div>添加任何属性。

我没有生成您的HTML代码,但您可以这样做:

  1. 使用谷歌浏览器检查灯箱(右键点击灯箱并检查元素)以查看<div>的班级。
  2. <a>添加新的“onclick”属性,并使用javascript restyle元素...
  3. 但你应该从jar文件中修改primefaces的css ...我没有找到优雅的javascript方法......