Jquery Mobile --小知识
1、更改ul后要使用listview('refresh')刷新視圖;
?$('ul').append('<li>row</li>').listview('refresh');
?
2、選取header,并綁定雙擊事件
?$("[data-role='header']").bind('dblclick',function(e){});
?
3、定時變換背景,長按為taphold
?$('#txt').tap(function(){
?var elem = this;
?$(elem).css('background','yellow');
?setTimeout(function(){$(elem).css('background','transparent');},2000);
?});
?});
?
4、取消Ajax鏈接
?頁面默認(rèn)為Ajax鏈接,要把它禁用,有三種方法
?A、<a href="second.html" data-ajax="false">Second</a>
?B、rel="external"
?C、$.mobile.ajaxEnabled=false;
?
5、圖標(biāo)data-icon類型
?home | delete | plus | arrow-u | arrow-d |? arrow-r | arrow-l|check | gear | grid | star | custom? | minus | refresh | forward | back | alert | info | search
?
6、Button大小
?默認(rèn)為屏幕同寬,若要變小使用data-inline="true"
?
7、只有圖標(biāo)的按鈕
?添加data-iconpos="notext"
?
8、使buttom在header右方
?
class="ui-btn-right"
?
?
9、設(shè)置<li class="span">有驚喜,轉(zhuǎn)個不停。
?
?
10、固定頁面:document.addEvenListener('touchmove',function(e){e.preventDefault();},false);
?
?
11、phoneGap中報(bào)錯ERROR whitelist rejection: url
?
在PhoneGap.plist里,ExternalHosts加個域名,注意不要協(xié)議頭,不要路勁和文件名,只要域名(如www.baidu.com)。
?
?
12、取消字段截?cái)?br />?
button中
?
.ui-btn-text{
?
white-space:normal;}
?
list中
?
.ui-li-desc{
?
white-space:normal;}
?
?
13、禁用button
?
$('#home-button').button('disable');
?
?
14、去除list中的箭頭
?
<li data-icon="false"><a>row</a></li>
?
?
15、設(shè)置頁面背景顏色
?
.ui-page{
?
background:#eee;;}
轉(zhuǎn)載于:https://blog.51cto.com/shaotao/1622075
總結(jié)
以上是生活随笔為你收集整理的Jquery Mobile --小知识的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: socket开发
- 下一篇: linux GUI程序开发