-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indentation for specific options #230
Comments
You can target the specific options with the |
Thank you. Also how to extract the length of the number from the option using javascript Please provide your suggestions on this? |
Can you provide a codepen or jsbin example? |
Sorry.We are using dropkick for drop down and knockout for bindings.. I have tried adding class to the options using $(#id ul li).addClass('temp'); How to select text of anchor tag using jquery |
Something this should do: $("#id li").each(function(){
if($(this).length > 3){
$(this).addClass("temp");
}
}); I haven't tested the code so it will probably take some adjusting. |
Thank you for your suggestions. |
If you could, at the least, provide us with some bit of you're markup it would be much much easier to help you out. If your markup looks something like this (from what I can gather from your previous responses):
then you are going to need a regular expression to extract the numbers. Something like this should be what you need:
Alternatively, If the options are going to reliably contain "abc(some number)", then you could forgo the regular expression and just add the length of the other text to your check. Minus the length of the number, that example contains 5 characters. So your expected length should be 8. Any classes an option contains will be carried over to the Dropkick's elements. Then just style jQuery Equivalent:
|
I have to include indentation for specific options based on condition in the drop down option.
Can you please provide me your suggestions?
The text was updated successfully, but these errors were encountered: