theaccordance
theaccordance

Reputation: 889

jQuery Mobile - Data Attribute options for listview icons

With collapsible sets, there are a few attributes that you can use to define the icon in the collapsible item's various states, for example:

data-collapsed-icon="arrow-down"  data-expanded-icon="arrow-up"

Does anyone know if there are similar attributes available for the listview widget? I'd like to set an attribute to use a specific icon when the listview item is set to active.

Upvotes: 1

Views: 89

Answers (1)

Jama A.
Jama A.

Reputation: 16079

I'm not sure whether such attributes like collapsible's but, you can do like this:

$('#yourpage').live('pagebeforeshow',function(e,data){    
    $("li").tap(function() {
        $(this).buttonMarkup({ icon: "myicon" });
    });  
});

Upvotes: 2

Related Questions