jquery - Add images in select dropdown box -
i trying add small images options in drop down box in form, rather text. works in firefox (but nobody uses firefox anymore right?!) need way chrome primarily. keep coming across ddslick thing cannot download site want alternate method. appreciated!
html:
select#severity option[value="minor"] { background: url(../assets/constants/minor.png); } select#severity option[value="moderate"] { background: url(../assets/constants/moderate.png); } select#severity option[value="major"] { background: url(../assets/constants/major.png); }
<div class="variables"> <select name="severity" id="severity" class="icon-menu"> <option value="severity" selected disabled>please select</option> <option value="minor">minor</option> <option value="moderate">moderate</option> <option value="major">major</option> </select> </div>
you can try
<select name="webmenu" id="webmenu"> <option value="calendar" data-image="icons/icon_calendar.gif">calendar</option> <option value="shopping_cart" data-image="icons/icon_cart.gif">shopping cart</option> <option value="cd" data-image="icons/icon_cd.gif">cd</option> <option value="email" selected="selected" title="icons/icon_email.gif">email</option> <option value="faq" data-image="icons/icon_faq.gif">faq</option> <option value="games" data-image="icons/icon_games.gif">games</option> </select>
credit http://www.marghoobsuleman.com/jquery-image-dropdown thankyou
Comments
Post a Comment