使用JavaScript创建JQuery移动按钮
Create JQuery Mobile button using JavaScript
我需要帮助使用JavaScript创建jQuery移动按钮,我使用下面的代码,它创建一个按钮,但它不识别jQuery移动样式。谢谢你的帮助:)
function SubmitForm() {
var list = document.getElementById("forMore"); // Get the <ul> element with id="forMore"
if (list.hasChildNodes()) { // It has at least one
list.removeChild(list.childNodes[0]);
}
var e = document.getElementById("services");
var strUser = e.options[e.selectedIndex].value;
var id = e.options[e.selectedIndex].id;
document.getElementById("desc").innerHTML = strUser;
document.getElementById("fields").style.visibility = "visible";
var td = document.getElementById('forMore');
var btn = document.createElement('input');
btn.setAttribute("data-role", "button");
btn.setAttribute("data-theme", "b");
btn.setAttribute("class", "ui-input-btn");
btn.style.cssFloat = "left";
btn.style.fontSize = "18px";
btn.style.fontFamily = "myAccountFont";
btn.style.color = "green";
btn.onclick = function () {
location.href = "/Pin/SendVas?id=" + id;
};
btn.value = "تفعيل";
td.appendChild(btn);
}
希望对您有所帮助:
var a = document.createElement("A");
a.appendChild(document.createTextNode("Name"));
a.setAttribute("data-role","button");
a.setAttribute("data-inline","true");
a.setAttribute("data-corner","false");
$(td).append(a).trigger('create');
//Or user parent container:
$("#container").trigger('create');
相关文章:
- iPhone锚点,scrollTop,scrollTo显示移动按钮栏,但不会滚动或跳到锚点
- jQuery 移动按钮无法按预期工作
- 使用jQuery单击移动按钮
- 使用 ng 类移动按钮
- 移动按钮未收到单击事件
- 如何禁用/启用 jQuery 移动按钮
- 如何模拟拖动事件(单击鼠标移动按钮)
- 单击边框时,将单击事件绑定到jquery移动按钮不起作用
- 在javascript中使用css移动按钮
- 如何在不丢失格式的情况下刷新包含JQuery移动按钮的表
- 我想使用jquery左右移动按钮
- 我需要移动按钮左右,然后再次使用jquery左右
- jQuery移动按钮点击事件不工作
- 触发dojox移动按钮的单击事件
- jQuery移动按钮有时只被选中,但没有发生页面过渡
- Jquery移动按钮不工作在第二次点击
- Jquery移动按钮点击在角落不工作
- 如何获得一个Jquery移动按钮打开特定的可折叠列表Id
- Javascript移动按钮并求助于slice
- 使用JavaScript创建JQuery移动按钮