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

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -