简体   繁体   中英

How to set length of slider in Primefaces (JSF)?

My code in ICEfaces (ACE Component), i have to change into Primefaces. There is conflict when i set length of Primefaces slider.

Sample ICEfaces (ACE Component) code:

<ace:sliderEntry id="slide" length="500px" min="0" max="1000" value="#{cal.value}" />   

When i come up with Primefaces, i did't find any attribute named length to set length of slider.

Sample Primefaces code:

<p:slider id="slide" minValue="0" maxValue="1000" value="#{cal.value}" />

Now, How to set length of slider in Primefaces (JSF)?

Set the desired width in the style or styleClass of your component

Style

<p:slider for="txt2" display="output" style="width:200px" .....>

StyleClass:

In your xhtml:

<p:slider for="txt2" display="output" styleClass="slider_style" .....>

In your CSS:

.slider_style{
    width:200px;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM