我是IOS Js的新手,我想在下面的iFrame中添加两个按钮。然后点击那些按钮。任何帮助将不胜感激。
var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
window.frames[0].window.alert('Please select the area multiplier');
iframe.parentNode.removeChild(iframe);
如果有任何其他方式来制作iFrame,或者我可以在iFrame中添加下拉菜单并获取下拉菜单中的所选项目。请让我知道
答案 0 :(得分:0)
说到定位,一般的ui小部件会看Bootstrap。
W3有关于bootstrap的精彩教程部分,你会惊讶于这些日子开箱即用的内容。
为什么使用iframe?
下面是一些可以简化代码的提示:
var iframe = document.createElement("IFRAME");
iframe.setAttribute("src", 'data:text/plain,');
document.documentElement.appendChild(iframe);
如果你正在使用jQuery,你可以:
var iframe = $('<iframe src="data:text/plain,"></iframe>');
$(document).appendChild(iframe);
iframe.contentWindow.targetFunction().alert('please select the area multiplier');
答案 1 :(得分:0)
我使用了一系列div
var mainCan=document.getElementById("cont");
var mainCategoryDiv;
mainCategoryDiv && mainCategoryDiv.parentNode.removeChild(mainCategoryDiv);
mainCategoryDiv = document.createElement("div");
mainVarS(mainCategoryDiv, "position", "absolute", "left", "0px", "top", "0px", "width", 645 + "px", "height", 700 + "px", "backgroundColor", "rgba(32,32,97,0.6)");
mainCan.parentNode.appendChild(mainCategoryDiv);