日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

jQuery Mobel 学习相关资料整理(一)

發布時間:2023/12/8 编程问答 27 豆豆
生活随笔 收集整理的這篇文章主要介紹了 jQuery Mobel 学习相关资料整理(一) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

  在Jquery Mobile中,一個頁面"就是一個data-role屬性被設為"page"的容器(通常為div容器),里面包含了"header", "content",“footer"三個容器,各自可以容納普通的html元素,表單和自定義的Jquery Mobile組件

1、一個標準的Jquery Mobile頁面的樣板。

<!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.0a3/Jquery.mobile-1.0a3.min.css" /><script type="text/javascript" src="http://code.Jquery.com/Jquery-1.4.3.min.js"></script><script type="text/javascript" src="http://code.Jquery.com/mobile/1.0a3/Jquery.mobile-1.0a3.min.js"></script></head> <body> <div data-role="page"><div data-role="header"><h1>Page Title</h1></div><!-- /header --><div data-role="content"> <p>Page content goes here.</p> </div><!-- /content --><div data-role="footer"><h4>Page Footer</h4></div><!-- /footer --></div><!-- /page --></body></html>

2、想要支持中文,添加以下meta標簽。

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

3、一個頁面中包含多個頁面,支持Ajax的跳轉的頁面。

<body> <!-- Start of first page --><div data-role="page" id="foo"><div data-role="header"><h1>Foo</h1></div><!-- /header --><div data-role="content"> <p>I'm first in the source order so I'm shown as the page.</p> <p>View internal page called <a href="#bar">bar</a></p> </div><!-- /content --><div data-role="footer"><h4>Page Footer</h4></div><!-- /footer --></div><!-- /page --><!-- Start of second page --><div data-role="page" id="bar"><div data-role="header"><h1>Bar</h1></div><!-- /header --><div data-role="content"> <p>I'm first in the source order so I'm shown as the page.</p> <p><a href="#foo">Back to foo</a></p> </div><!-- /content --><div data-role="footer"><h4>Page Footer</h4></div><!-- /footer --></div><!-- /page --></body>


4、后退鏈接屬性。(后退的行為,會無視鏈接的herf)? data-rel="back"

<a href="index.html" data-rel="back">后退</a>

?

5、頁面跳轉效果屬性。 data-transition="*"

<a href="index.html" data-transition="pop">跳轉</a>
  • data-transition="fade"
  • data-transition="pop"
  • data-transition="flip"
  • data-transition="turn"
  • data-transition="flow"
  • data-transition="slidefade"
  • data-transition="slide"
  • data-transition="slideup"
  • data-transition="slidedown"
  • data-transition="none"?
  • 6、在頁面上層的彈出對話框屬性。 data-rel="dialog"

    ?

    <a href="foo.html" data-rel="dialog">Open dialog</a>

    ?

    7、頁面預加載屬性。data-prefetch

    <a href="prefetchThisPage.html" data-prefetch> ... </a>

    你可以預加載隨意多個頁面,只需要將要預加載的鏈接加上data-prefetch屬性。或者你,可以在js里調用$.mobile.loadPage()方法來設置預加載。

    $.mobile.loadPage( pageUrl, { showLoadMsg: false } );

    8、不使用jQuery Mobel 提供的? DOM 緩存機制屬性。data-dom-cache="true"

    <div data-role="page" id="cacheMe" data-dom-cache="true">

    通過js控制。

    $.mobile.page.prototype.options.domCache = true;

    通過程序控制。

    pageContainerElement.page({ domCache: true });

    DOM緩存的缺點是DOM可能會變得很大,某些設備上會導致變慢或者內存問題。

    ?

    ?

    ?

    轉載于:https://www.cnblogs.com/liluping860122/archive/2013/05/08/3067258.html

    總結

    以上是生活随笔為你收集整理的jQuery Mobel 学习相关资料整理(一)的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。