Problem CSS when using Jquery
Hi,
I have a really strange error. When I use some Jquery function, the css doesn't works. I give you an exemple :
The first list looks good (l.16), but the second using Jquery doesn't works (l.36).
Thanks !
- <!DOCTYPE html>
- <html>
- <head>
- <title>Page Title</title>
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.css" />
- <script src="http://code.jquery.com/jquery-1.8.2.min.js"></script>
- <script src="http://code.jquery.com/mobile/1.3.0/jquery.mobile-1.3.0.min.js"></script>
- </head>
- <body>
- <div data-role="page">
- <div data-role="header"><h1>Page Title</h1></div>
- <div data-role="content" id="content_">
-
- <ul data-role="listview" data-divider-theme="b" data-inset="true" id="ul">
- <li data-role="list-divider" role="heading">
- Divider
- </li>
- <li data-theme="c">
- <a href="#page1" data-transition="slide">
- title 1
- </a>
- </li>
- <li data-theme="c" id="li2">
- <a href="#page1" data-transition="slide">
- title 2
- </a>
- </li>
- </ul>
- </div>
-
- <script type="text/javascript">
- $(function(){
-
- $('<ul data-role="listview" data-divider-theme="b" data-inset="true"><li data-theme="c" ><a href="#page1" data-transition="slide">new title</a></li></ul>')
- .insertAfter('#ul');
-
- });
- </script>
-
-
- </div><!-- /page -->
- </body>
- </html>