2011-11-02 70 views
0

我使用PrimeFaces 1.1和JSF 1.2。 我需要將具有黑色邊框的PrimeFaces <p:lightBox>疊加層的樣式更改爲藍色,但組件的style屬性不會更改疊加層,而只會更改調用lightbox的鏈接。更改LightBox Primefaces的樣式邊框

<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> 

回答

0

如果我沒有錯,那就是<a>標籤生成。我不知道是否可以將任何屬性添加到燈箱的<div>

我沒有生成的HTML代碼,但你可以這樣做:

  1. 使用谷歌瀏覽器檢查收藏夾(右鍵單擊收藏夾和檢查元素),查看<div>的課。
  2. 添加一個新的「點擊」屬性<a>和使用JavaScript restyle元素...

但是,你應該從jar文件修改primefaces的CSS ...我不覺得JavaScript方法優雅。 ..

+0

亞克斯爲您的重播,這是鏈接,你可以找到生成的HTML代碼:http://www.primefaces.org/showcase/ui/lightBoxExternal.jsf –

+0

我做了一些修改的CSS文件,嵌入在primefaces jar中,但是當我將新jar包含在項目中時,primefaces API不起作用 –

+0

@ANIS BOULILA hei ..不要這樣做...只是創建一個新的css而我在你的頁面中(鏈接所在的位置)nclude ...來自primefaces的css屬性應該被你的css文件覆蓋 – Alex