Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Prevent first option topOptionText from being clickable #14

Open
amazingBytes opened this Issue · 0 comments

1 participant

@amazingBytes

To prevent the first option from being clickable I'd like to suggest the following addition of a function and a slightly change of code.

New function:

//function to create first option in the select menu
function createFirstOption($container){

        $('<option selected="selected" disabled="disabled" value="0">'+settings.topOptionText+'</option>').appendTo($container);
}//createFirstOption()

Within the function createSelect() use instead of

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createOption($('<li>'+settings.topOptionText+'</li>'), $select);
    }

the code

    //create default option if the text is set (set to null for no option)
    if(settings.topOptionText){
        createFirstOption($select);
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.