Change collapsible style

Description

The following code shows how to change collapsible style.

Example


<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'
  src='http://code.jquery.com/jquery-1.9.1.js'></script>
<script type='text/javascript'
  src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<link rel="stylesheet" type="text/css"
  href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css">
<script type='text/javascript'>//<![CDATA[ 
$(window).load(function(){<!--from  w ww . java 2 s .c  om-->
$('#coll').bind('expand', function () { 
    var oldclass = 'ui-btn-up-b ui-body-b';
    var newclass = 'ui-btn-up-d ui-body-d';
    $('[data-role=collapsible]').find('a').removeClass(oldclass  + ' ui-btn-hover-b').addClass(newclass + ' ui-btn-hover-d');
    $('[data-role=collapsible]').find('.ui-collapsible-content').removeClass(oldclass).addClass(newclass);
    $(this).trigger('create');
});
});//]]>  
</script>
</head>
<body>
  <div data-role="collapsible" id="coll" data-theme="b">
    <h4>Heading</h4>
    <p>I'm the collapsible content. </p>
  </div>

</body>
</html>

Click to view the demo





















Home »
  jQuery Mobile »
    Example »




Button
Button Event
Button Icon
Button Text
Checkbox
Collapsible
Date
Dialog
Event
Footer
Form
Header
Icon
Input
Layout
Listview
Listview Divider
Listview Item
Loader
mobile_settings
Navbar
Page
Page Event
Popup
Radio
Select
Slider
Switch
Textarea
Theme