Change the icon of a jQuery UI button with own image

后端 未结 7 1708
慢半拍i
慢半拍i 2020-12-10 01:31

Currently I have the following jQuery UI button:

$(\'#button\').button(
  {
    label: \'Test\',
    icons: {primary: \'ui-icon-circle-plus\', secondary: nul         


        
7条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 01:32

    Check this link:

    http://www.andymatthews.net/read/2011/02/13/Creating-and-using-custom-icons-in-jQuery-Mobile

    .bouton-image { background: #004963; width: 80px; }
    .ui-icon-wifi {
       width: 80px;
       height: 80px;
       background-color: #004963;
       background-image: url(../images/icones/icone_wifi_ispsm_mobile.png);
       background-position: 40% 40%;
    }

    In "data-icon" just put whatever you want and jquery will create the class for you.

提交回复
热议问题