Advertisement
Guest User

Untitled

a guest
Oct 25th, 2013
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.42 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="ISO-8859-1">
  5. <title>Insert title here</title>
  6. <script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.js"></script>
  7. <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.css">
  8. <script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
  9. <style type="text/css">
  10. #home{
  11. position:relative
  12. }
  13. #firstpage{
  14. position:absolute; bottom:0;
  15. }
  16.  
  17. </style>
  18. <script type="text/javascript">//<![CDATA[
  19. $(document).on('pageinit', '#home', function(){
  20. $(document).on ('click','#firstbutton', function () {
  21. $.mobile.changePage('#firstpage', {
  22. transition: 'slideup',
  23. changeHash: true,
  24. role: 'dialog'
  25. });
  26. $('#firstpage').position({
  27. my: 'right bottom',
  28. at: 'right top',
  29. of: $('#home'),
  30. offset: '0 5',
  31. collision: 'flip flip',
  32. using: function (pos1) {
  33.  
  34. // OK, we got a position once inside the pos1 variable,
  35. // let's position it again this time without collision detection.
  36. $(this).position({
  37. my: 'right bottom',
  38. at: 'right top',
  39. of: $('#home'),
  40. offset: '0 5',
  41. collision: 'none none',
  42. using: function(pos2) {
  43. var hpos = 'right';
  44. var vpos = 'bottom';
  45.  
  46. // Check to see if it was flipped horizontal
  47. if (pos1.left != pos2.left) {
  48. /* It was flipped horizontally so position is now
  49. my: 'left bottom',
  50. at: 'left top'
  51. */
  52. hpos = 'left';
  53. }
  54.  
  55. // Check to see if it was flipped vertical
  56. if (pos1.top != pos2.top) {
  57. /* It was flipped vertically */
  58. vpos = 'top';
  59. }
  60.  
  61. // Figure out the right and bottom css properties
  62. var right = $(window).width() - pos1.left - $(this).outerWidth(true);
  63. var bottom = $(window).height() - pos1.top - $(this).outerHeight(true);
  64.  
  65. // Set the horizontal position
  66. if (hpos == 'right') {
  67. $(this).css({left: '', right: right});
  68. } else {
  69. $(this).css({left: pos1.left, right: ''});
  70. }
  71.  
  72. // Set the vertical position
  73. if (vpos == 'bottom') {
  74. $(this).css({top: '', bottom: bottom});
  75. } else {
  76. $(this).css({top: pos1.top, bottom: ''});
  77. }
  78. }
  79. });
  80. }
  81. });
  82. });
  83.  
  84. $(document).on('click','#first',function () {
  85. window.location.href = "#first";
  86. });
  87. $(document).on('click','#second',function () {
  88. window.location.href = "#second";
  89. });
  90. });//]]>
  91.  
  92. </script>
  93. <script type="text/javascript">//<![CDATA[
  94. $(document).on('pageinit', '#home', function(){
  95. var myPos = [$(window).width() / 2 - 300, 300];
  96. $(document).on ('click','#secondbutton', function () {
  97. $.mobile.changePage('#secondpage', {
  98. transition: 'slideup',
  99. changeHash: true,
  100. position: myPos,
  101. role: 'dialog'
  102. });
  103. $('secondpage').dialog('option', 'position', 'right');
  104. });
  105.  
  106. $(document).on('click','#third',function () {
  107. window.location.href = "#third";
  108. });
  109. $(document).on('click','#fourth',function () {
  110. window.location.href = "#fourth";
  111. });
  112. });//]]>
  113.  
  114. </script>
  115. </head>
  116. <body>
  117. <div data-role="page" id="home">
  118. <div data-role="footer" data-position="fixed" class="ui-footer ui-bar-a ui-footer-fixed slideup" data-theme="c">
  119. <div data-role="navbar" data-theme="c">
  120. <ul>
  121. <li>
  122. <button id="firstbutton" data-corners="false" data-theme="c">first button</button>
  123. </li>
  124. <li>
  125. <button id="secondbutton" data-corners="false" data-theme="c">second button</button>
  126. </li>
  127. </ul>
  128. </div>
  129. </div>
  130. </div>
  131.  
  132. <div data-role="dialog" id="firstpage" data-theme="a" style="background:black;">
  133. <div data-role="content">
  134. <a href="#" id="first" data-role="button" data-icon="false" style="color: white; background:red;">first</a>
  135. <a href="#" id="second" data-role="button" data-icon="false" style="color: white; background:red;">second</a>
  136.  
  137. </div>
  138. </div>
  139. <div data-role="dialog" id="secondpage" data-theme="a">
  140. <div data-role="content">
  141. <a href="#" id="third" data-role="button" data-icon="false" style="color: White; background:green;">third</a>
  142. <a href="#" id="fourth" data-role="button" data-icon="false" style="color: White; background:green;">fourth</a>
  143.  
  144. </div>
  145. </div>
  146. <div data-role="page" id="first" data-theme="c" data-transition="slideup">
  147. <div data-role="content" style="text-align: center;" data-theme="c" data-inline="true">
  148. <div>
  149. <input type="text" id="second" placeholder="first page">
  150. <div class="ui-grid-a">
  151. <div class="ui-block-a">
  152. <div data-role="fieldcontain" align="right">
  153. <a style="width:25%" data-role="button" id="first" href="#">first</a>
  154. </div>
  155. </div>
  156. <div class="ui-block-b">
  157. <div data-role="fieldcontain" align="left">
  158. <a style="width:25%" data-role="button" id="esecond" href="#">second</a>
  159. </div>
  160. </div>
  161. </div>
  162. <div class="ui-grid-c">
  163. <div class="ui-block-a">
  164. <a href="#" data-role="button" data-icon="false" style="color: White; background:green;">first</a>
  165. </div>
  166. <div class="ui-block-b">
  167. <a href="#" data-role="button" data-icon="false" style="color: Black; background:yellow;">second</a>
  168. </div>
  169. <div class="ui-block-c">
  170. <a href="#" data-role="button" data-icon="false" style="color: white; background:black;">third</a>
  171. </div>
  172. <div class="ui-block-d">
  173. <a href="#" data-role="button" data-icon="false" style="color: White; background:red;">fourth</a>
  174. </div>
  175. </div>
  176. </div>
  177.  
  178. <div data-role="footer" data-position="fixed" class="ui-footer ui-bar-a ui-footer-fixed slideup" data-theme="c">
  179. <div data-role="navbar" data-theme="c">
  180. <ul>
  181. <li>
  182. <button id="firstbutton" data-corners="false" data-theme="c">first button</button>
  183. </li>
  184. <li>
  185. <button id="secondbutton" data-corners="false" data-theme="c">second button</button>
  186. </li>
  187. </ul>
  188. </div>
  189.  
  190. </div>
  191. </div>
  192. </div>
  193. <div data-role="page" id="second" data-theme="c" data-transition="slideup">
  194. <div data-role="header" ></div>
  195. <div data-role="content" style="text-align: center;" data-theme="c" data-inline="true">
  196. <div>
  197. <input type="text" id="second" placeholder="Second Page">
  198. <div class="ui-grid-a">
  199. <div class="ui-block-a">
  200. <div data-role="fieldcontain" align="right">
  201. <a style="width:25%" data-role="button" id="first" href="#">first</a>
  202. </div>
  203. </div>
  204. <div class="ui-block-b">
  205. <div data-role="fieldcontain" align="left">
  206. <a style="width:25%" data-role="button" id="esecond" href="#">second</a>
  207. </div>
  208. </div>
  209. </div>
  210. <div class="ui-grid-c">
  211. <div class="ui-block-a">
  212. <a href="#" data-role="button" data-icon="false" style="color: White; background:green;">first</a>
  213. </div>
  214. <div class="ui-block-b">
  215. <a href="#" data-role="button" data-icon="false" style="color: Black; background:yellow;">second</a>
  216. </div>
  217. <div class="ui-block-c">
  218. <a href="#" data-role="button" data-icon="false" style="color: white; background:black;">third</a>
  219. </div>
  220. <div class="ui-block-d">
  221. <a href="#" data-role="button" data-icon="false" style="color: White; background:red;">fourth</a>
  222. </div>
  223. </div>
  224. </div>
  225.  
  226.  
  227. <div data-role="page" id="home">
  228. <div data-role="footer" data-position="fixed" class="ui-footer ui-bar-a ui-footer-fixed slideup" data-theme="c">
  229. <div data-role="navbar" data-theme="c">
  230. <ul>
  231. <li>
  232. <button id="firstbutton" data-corners="false" data-theme="c">first button</button>
  233. </li>
  234. <li>
  235. <button id="secondbutton" data-corners="false" data-theme="c">second button</button>
  236. </li>
  237. </ul>
  238. </div>
  239. </div>
  240. </div>
  241. </div>
  242. </div>
  243. <div data-role="page" id="third" data-theme="c" data-transition="slideup">
  244. <div data-role="content" style="text-align: center;" data-theme="c" data-inline="true">
  245. <div>
  246. <input type="text" id="second" placeholder="third page">
  247. <div class="ui-grid-a">
  248. <div class="ui-block-a">
  249. <div data-role="fieldcontain" align="right">
  250. <a style="width:25%" data-role="button" id="first" href="#">first</a>
  251. </div>
  252. </div>
  253. <div class="ui-block-b">
  254. <div data-role="fieldcontain" align="left">
  255. <a style="width:25%" data-role="button" id="esecond" href="#">second</a>
  256. </div>
  257. </div>
  258. </div>
  259. <div class="ui-grid-c">
  260. <div class="ui-block-a">
  261. <a href="#" data-role="button" data-icon="false" style="color: White; background:green;">first</a>
  262. </div>
  263. <div class="ui-block-b">
  264. <a href="#" data-role="button" data-icon="false" style="color: Black; background:yellow;">second</a>
  265. </div>
  266. <div class="ui-block-c">
  267. <a href="#" data-role="button" data-icon="false" style="color: white; background:black;">third</a>
  268. </div>
  269. <div class="ui-block-d">
  270. <a href="#" data-role="button" data-icon="false" style="color: White; background:red;">fourth</a>
  271. </div>
  272. </div>
  273. </div>
  274. <div data-role="page" id="home">
  275. <div data-role="footer" data-position="fixed" class="ui-footer ui-bar-a ui-footer-fixed slideup" data-theme="c">
  276. <div data-role="navbar" data-theme="c">
  277. <ul>
  278. <li>
  279. <button id="firstbutton" data-corners="false" data-theme="c">first button</button>
  280. </li>
  281. <li>
  282. <button id="secondbutton" data-corners="false" data-theme="c">second button</button>
  283. </li>
  284. </ul>
  285. </div>
  286. </div>
  287. </div>
  288. </div>
  289. </div>
  290. <div data-role="page" id="fourth" data-theme="c" data-transition="slideup">
  291. <div data-role="content" style="text-align: center;" data-theme="c" data-inline="true">
  292. <div>
  293. <input type="text" id="second" placeholder="fourth page">
  294. <div class="ui-grid-a">
  295. <div class="ui-block-a">
  296. <div data-role="fieldcontain" align="right">
  297. <a style="width:25%" data-role="button" id="first" href="#">first</a>
  298. </div>
  299. </div>
  300. <div class="ui-block-b">
  301. <div data-role="fieldcontain" align="left">
  302. <a style="width:25%" data-role="button" id="esecond" href="#">second</a>
  303. </div>
  304. </div>
  305. </div>
  306. <div class="ui-grid-c">
  307. <div class="ui-block-a">
  308. <a href="#" data-role="button" data-icon="false" style="color: White; background:green;">first</a>
  309. </div>
  310. <div class="ui-block-b">
  311. <a href="#" data-role="button" data-icon="false" style="color: Black; background:yellow;">second</a>
  312. </div>
  313. <div class="ui-block-c">
  314. <a href="#" data-role="button" data-icon="false" style="color: white; background:black;">third</a>
  315. </div>
  316. <div class="ui-block-d">
  317. <a href="#" data-role="button" data-icon="false" style="color: White; background:red;">fourth</a>
  318. </div>
  319. </div>
  320. </div>
  321. <div data-role="page" id="home">
  322. <div data-role="footer" data-position="fixed" class="ui-footer ui-bar-a ui-footer-fixed slideup" data-theme="c">
  323. <div data-role="navbar" data-theme="c">
  324. <ul>
  325. <li>
  326. <button id="firstbutton" data-corners="false" data-theme="c">first button</button>
  327. </li>
  328. <li>
  329. <button id="secondbutton" data-corners="false" data-theme="c">second button</button>
  330. </li>
  331. </ul>
  332. </div>
  333. </div>
  334. </div>
  335. </div>
  336. </div>
  337. </body>
  338. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement