gfranko / jquery.selectBoxIt.js

A jQuery Select Box Plugin for Mobile, Tablet, and Desktop
http://www.selectboxit.com
MIT License
852 stars 301 forks source link

Changing color of .selectboxit-text if an item has been selected #329

Open lsterling03 opened 9 years ago

lsterling03 commented 9 years ago

I'm trying to change the color of the span.selectboxit-text if a selection has been made in the dropdown. There doesn't seem to be a class applied if you have made a selection. I tried adding a class via the events, but I'm using the dropdown on a search page, and it doesn't hold the class once the page refreshes (even though the selected <option> does retain the selected class).

Is there a way to add a class to the selectboxit-container or selectboxit-text if any selected option (other than the default option) exists in its associated dropdown?

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

alisonjoseph commented 9 years ago

Were you able to resolve this? I'm trying to do the same thing. Thanks

oddnavy commented 9 years ago

I was able to achieve this with CSS by using the data-val attribute to set the 'placeholder' colour e.g:

.selectboxit-text[data-val=""] {
    color: #999;
    font-style: italic;
}
lalithamadhuriv commented 8 years ago

try this

.selectboxit-selected a.selectboxit-option-anchor { color: #FFFFFF; }