Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
411 views
in Technique[技术] by (71.8m points)

themes - change jquery mobile color swatch dynamically

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 that's to messy).
Whats the best way to do that?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

At least in 1.2.0 (1.2.0-rc1) its as simple as (probably it works in minor versions):

$( "#myButton" ).buttonMarkup({theme: 'd'});

not .button('refresh') needed


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...