可折叠A:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> <meta charset="utf-8"> </head> <body> <div data-role="page" id="pageone"> <div data-role="header"> <h1>嵌套的可折叠块</h1> </div> <div data-role="content"> <div data-role="collapsible"> <h1>点击我 - 我可以折叠!</h1> <p>我是可折叠的内容。</p> <div data-role="collapsible"> <h1>点击我 - 我是嵌套的可折叠块!</h1> <p>我是嵌套的可折叠块中被展开的内容。</p> </div> </div> </div> <div data-role="footer"> <h1>页脚文本</h1> </div> </div> </body> </html>
可折叠B:
<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> <meta charset="utf-8"> </head> <body> <div data-role="collapsible-set"> <div data-role="collapsible"> <h1>点击我 - 我可以折叠!</h1> <p>我是被展开的内容。</p> </div> <div data-role="collapsible"> <h1>点击我 - 我可以折叠!</h1> <p>我是被展开的内容。</p> </div> </div> </body> </html>