On this fiddle when I click disable’Li Point1′ the text ebcomes greyed out http://jsfiddle.net/adrianjsfiddlenetuser/Q9sHz/14/
Can the original styling of the element be maintained(not greyed out) ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have three options. You can either remove the styles from jquery-ui.css for
.ui-state-disabled, you can override the style in your own custom style sheet, or you can flag the altered properties as!important.Remove Styles
To remove the styles, you need to edit
jquery-ui.cssand look for the.ui-state-disabledrule (in jQuery 1.7.2, it’s on line 262). Remove all the styles within there (you’ll see three,opacity,filter, andbackground-image.The disadvantage of this is that if you ever update jQuery and get a new CSS file to go with it, you’ll lose your edits.
Add Own Stylesheet
You can add your own rule for
.ui-state-disabledand change the style of disabled elements. Sinceui-state-disabledis used for everything in jQuery that is disabled, I’d suggest defining your rule as exclusive toli, or set a class on youruland define the styles for that specifically.Flag as !important
You can also add the opacity, filter, and background-image style to other rules that define how that particular item is supposed to appear and use the
!importantflag. It isn’t the most recommended way of doing things, though, because it can wreak havoc on your CSS style debugging if you forget that you flagged it, but it is an option. To do that, you simply style yourlias such:Note that in this case, if you aren’t setting a background image on the draggable, then you don’t need the line to set the background-image; just set
opacityandfilterto be un-overridden. Also note that these CAN be overridden by JavaScript, so they aren’t set in stone.Of the three, you may need to use a combination. My suggestions is to use your own custom stylesheet to override the
opacityandfilterproperties. If you are using background-images, you may need to use!importantto keep it from being removed by theui-state-disabledrule. But use the!importantflag as sparingly as possible.