JQuery Mobile Custom Theme Buttons

后端 未结 1 517
别那么骄傲
别那么骄傲 2021-01-21 16:17

I just started using a jquery mobile custom theme instead of one of the defaults. Lots of issues...but the current one is that dynamically created buttons don\'t work as expecte

1条回答
  •  旧时难觅i
    2021-01-21 16:36

    data-role=button is deprecated so you need to add classes manually and it doesn't require any manual enhancement even if you append them dynamically. .button() is used for only.

    Your solution is as follows:

    var Btn = 'Button';
    
    $(".selector").append(Btn);
    
    • ui-btn-Custom: is theme swatch i.e. ui-btn-a

    • ui-btn-icon-Position: icon's position, left,right,top,bottom or notext i.e. ui-btn-icon-left

    • ui-icon-Name: icon's image i.e. ui-icon-home

    Demo

    0 讨论(0)
提交回复
热议问题