Adding an image next to jQuery Mobile Select Menu

Can I add any icon next to the jQuery Mobile selection menu in the image below? If so, what will be the size of the image? Thanks in advance!

enter image description here

+6
source share
1 answer

You can add icons to just about anything by adding the following options to the item you want to use to display inside:

data-icon="arrow-l" data-iconpos="left" 

Where arrow-l indicates an arrow pointing to the left.

If you want to specify your own icon / image, rather than using the one provided by jQuery Mobile, then you can add the image inside li (in front of the text) with the class either ui-li-icon or ui-li-thumb :

 <li> <img src="images/gf.png" alt="France" class="ui-li-icon"> <a href="#">Social Triangle</a> </li> 


ui-li-icon is apparently limited to 16px X 16px and uses the following css conditions:

 ui-li-icon { max-height: 16px; max-width: 16px; } 


ui-li-thumb is apparently limited to 80px X 80px and uses the following css conditions:

 .ui-li-thumb { max-height: 80px; max-width: 80px; } 

If you look at the jQuery Mobile documentation links above, it will show you how to use them in more detail, just check the source:

+3
source

Source: https://habr.com/ru/post/923703/


All Articles