Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <select id="icon">
- <option value="img`">Img 1</option>
- <option value="img2">Img 2</option>
- </select>
- var formatResult = function (state) {
- if (state.id === "profile") return "<img src='img.png' width=48 />";
- else return "<img src='img2.png' width=48 />";
- };
- $('#icon').select2({
- formatResult: formatResult,
- formatSelection: formatResult,
- minimumResultsForSearch: -1,
- width: 90
- });
- .select2-choice {
- height:60px !important;
- width:90px
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement