change jquery mobile color swatch dynamically

后端 未结 7 1093
隐瞒了意图╮
隐瞒了意图╮ 2020-12-17 18:13

I want to change a jquery-mobile buttons color swatch dynamically with javascript, but I can\'t\' find a way (except removing and adding all classes and event handlers, but

7条回答
  •  有刺的猬
    2020-12-17 18:46

    Buttons need to have the parent element theme changed as well.

    Add the following code to the end of the $.fn.changeColorSwatch function

          if(this.attr('type') == 'button'){
          this.parent().changeColorSwatch(theme, type);
      }
    

提交回复
热议问题