<ul data-role="listview" data-filter="true" data-filter-placeholder="请输入搜索内容..." data-filter-theme="b">
http://feifei.42t.com/doc/jm/demos/index.html
<script type="text/javascript">
$(document).bind("mobileinit", function() {
// $.mobile.defaultPageTransition = 'none'
// $.mobile.loadingMessage = '努力加载中...'
// $.mobile.page.prototype.options.backBtnText = '后退'
//$.mobile.page.prototype.options.addBackBtn= true
//$.mobile.ajaxLinksEnabled = false;
//$.mobile.page.prototype.options.domCache = false;
$.mobile.pushStateEnabled = false;
//$.mobile.ajaxEnabled = false;
// $("a[data-ajax='false']").bind("click", function() {
// $.mobile.pushStateEnabled = false;
// });
//
// $("a[data-ajax!='false']").bind("click", function() {
// $.mobile.pushStateEnabled = true ;
// });
});
//----------------------------------------------2012.4.8-------------------------------------------------------------------
禁用Ajax
function getXML() {
var xmlDom = new ActiveXObject("Msxml2.DOMDocument.3.0");
xmlDom.async = false;
xmlDom.loadXML("<root></root>");
var node = xmlDom.createNode(1, "submitInfo", "");
var id = xmlDom.createAttribute("id");
id.value = "12345678";
node.setAttributeNode(id);
// var mk_id = xmlDom.createAttribute("id");
// mk_id.value = str_mk_id;
// mk.setAttributeNode(mk_id);
// var sfkx = xmlDom.createAttribute("sfkx");
// sfkx.value = "0";
// mk.setAttributeNode(sfkx);
xmlDom.documentElement.appendChild(node);
document.getElementById("hiddenSelect").value = xmlDom.xml;
}
后台代码
//Response.Redirect("SecondPage.aspx");
//Response.Write("<script>document.location.href='SecondPage.aspx'</script>");
/*
XmlDocument xmlDom = new XmlDocument();
xmlDom.LoadXml(hiddenMK_IDs.Value);
XmlNodeList list = xmlDom.SelectNodes("//mk");
BoJS boJS = new BoJS();
boJS.JS_BZ = txtJS_BZ.Text.Trim();
boJS.JS_ID = Guid.NewGuid().ToString();
boJS.JS_XM = txtJS_XM.Text.Trim();
boJS.JS_MK_XML = hiddenMK_IDs.Value;
IList<BoJSMK> listBoJSMK = new List<BoJSMK>();
foreach (XmlNode node in list)
{
BoJSMK boJSMK = new BoJSMK();
boJSMK.JS_ID = boJS.JS_ID;
boJSMK.JSMK_SFKX = Convert.ToBoolean(Convert.ToInt32(node.Attributes["sfkx"].Value));
boJSMK.MK_ID = node.Attributes["id"].Value;
listBoJSMK.Add(boJSMK);
}
BomJS.Add(boJS, listBoJSMK);
SetNull();
OperatePage1.GoToFirstPage();
lblMessage.Text = MessageHelper.SUCCESS_MESSAGE_OF_ADD;
*/
//------------------------------2012-4-10----------------------------------------------------------------------------
$(document).ready(function() {
//为按钮ClickMe添加点击事件,此处为弹出对话框
//$('#testTap').tap(function() { alert('HelloWorld!'); });
$('#testTap').bind("tap", function() { testTapFun(this); });
});
// $("div[data-role='page']").live('pageshow', function(event, ui) {
// $('#testTap').bind("tap", function() { testTapFun(this); });
// });
// $("div[data-role='page']").live('pagehide', function(event, ui) {
// $('#testTap').unbind("tap");
// });
function testTapFun(obj) {
$("#custom_dialog").click();
//$.mobile.changePage("#test", { transition: "pop", changeHash: true });
}
<script language ="javascript" >
window.MobileAlert = function(obj, option) {
var title = option.title;
var content = option.content;
if ($("#custom_dialog").length == 0) {
var divPage = document.createElement("div");
divPage.setAttribute("data-role", "Page");
divPage.id = "page_custom_dialog";
var divHader = document.createElement("div");
divHader.id = "page_custom_dialog_header";
divHader.setAttribute("data-role", "header");
var h = document.createElement("h1");
h.id = "custom_dialog_title";
h.innerHTML = title;
divHader.appendChild(h);
var divContent = document.createElement("div");
divContent.id = "page_custom_dialog_content";
divContent.setAttribute("data-role", "content");
var span = document.createElement("span");
span.id = "custom_dialog_content";
span.innerHTML = content;
divContent.appendChild(span);
divPage.appendChild(divHader);
divPage.appendChild(divContent);
document.body.appendChild(divPage);
//-----------------------------------------
var a = document.createElement("a");
a.href = "#page_custom_dialog";
a.id = "custom_dialog";
a.setAttribute("data-rel", "dialog");
if (!obj) {
document.body.appendChild(a);
} else {
$(obj).parents("div[data-role='page']").first().append(a);
}
$("#custom_dialog").click();
} else {
$("#custom_dialog_title")[0].innerHTML = title;
$("#custom_dialog_title")[0].innerHTML = content;
$("#custom_dialog").click();
}
}
function showDialog(obj) {
MobileAlert(obj, {title:"My",content:"content"});
}
function showDialog2(obj) {
MobileAlert(obj, { title: "2222", content: "22233333" });
}
</script>
}
//---------------------------------2012.4.12---------------------------------------------------------
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0"/>
width - viewport的宽度 height - viewport的高度
initial-scale - 初始的缩放比例
minimum-scale - 允许用户缩放到的最小比例
maximum-scale - 允许用户缩放到的最大比例
user-scalable - 用户是否可以手动缩放
$("#pageList").dialog("close");
setTimeout(function() {
textarea.setSelectionRange(pos + sel.length, pos + sel.length);
},0);
复选框:
从待选移至已选:对于勾选的,先移除第一个的top,再移除最后一个的bottom和last;
如果已选项多于一项,则移除bottom和last;
追加Append;
在已选的最后一个中添加bottom和last;
在待选的第一个添加top,在待选的最后一个添加bottom和last
单选框:
从待选移至已选:将勾选项移至已选区;
如果待选中仍多于一项,则移除top/botto和last
若待选中存在,将待选中的top去除,移至已选区
对于待选区中的第一个添加top
对于已选区中的添加top/bottom和last
从已选移至待选:如果待选中为空,直接移动,结束。
否则,删除待选中最后一项的bottom和last;
删除已选中项的top;
移动Append