jQuery UI: How to change the color of a ProgressBar?

前端 未结 5 641
感情败类
感情败类 2020-11-29 02:27

I\'ve set up a simple jQueryUI progressbar:



        
5条回答
  •  眼角桃花
    2020-11-29 03:00

    One simple thing would be when you are initializing the progress bar with values in your js you do :

    $(progressBarId).children().css('backgroud',) ;
    
    

    Since you want different colors for different progressbars, you can do :

    if($(progressBarId).value() <10 )
    //set a color
    if (..)
    //set another color
    

    I hope this answers your question. I tried doing what the guy has said in the first answer, but could not get it to work so tried this and it started working.

提交回复
热议问题