通过Javascript在另一个HTML页面中显示HTML表单
我有两个单独的html文件。第一个是主页 第二个是属性面板,每当工具从左边的工具箱放到画布上时,该面板需要显示在上面页面画布的右边 我之前是这样做的,将属性面板表单作为与邮件页面(第一张图像)相同的html页面的一部分 但是,由于还有其他各种表单/属性面板,我考虑将其提取到不同的html表单中,并从我的jsGold.js文件中调用它们显示在这个位置(右侧) 文件结构如下: StreamProperty.html以以下形式保存属性面板表单通过Javascript在另一个HTML页面中显示HTML表单,javascript,jquery,html,forms,display,Javascript,Jquery,Html,Forms,Display,我有两个单独的html文件。第一个是主页 第二个是属性面板,每当工具从左边的工具箱放到画布上时,该面板需要显示在上面页面画布的右边 我之前是这样做的,将属性面板表单作为与邮件页面(第一张图像)相同的html页面的一部分 但是,由于还有其他各种表单/属性面板,我考虑将其提取到不同的html表单中,并从我的jsGold.js文件中调用它们显示在这个位置(右侧) 文件结构如下: StreamProperty.html以以下形式保存属性面板表单 <head> <link rel=
<head>
<link rel="stylesheet" type="text/css" href="../../CSS/style.css">
<link rel="stylesheet" type="text/css" href="../../CSS/propertybox.css">
</head>
<body>
<div style="float: left">
<h1 class="toolbox-titlex" id="tth">Properties Panel</h1>
<form class="panel" id="lot">
<label>Stream Type:</label>
<div class="panel-switch">
<input type="radio" name="TypeGen" value="G" id="type_g" class="panel-switch-input" checked>
<label for="type_g" class="panel-switch-label">Import</label>
<input type="radio" name="TypeGen" value="A" id="type_a" class="panel-switch-input">
<label for="type_a" class="panel-switch-label">Export</label>
<input type="radio" name="TypeGen" value="B" id="type_b" class="panel-switch-input">
<label for="type_b" class="panel-switch-label">Temporary</label>
</div>
<input type="text" class="panel-input-streamName" placeholder="Stream Name">
<input type="text" class="panel-input-streamDef" placeholder="Stream Definition">
<input type="button" value="Save" class="panel-button">
<input type="reset" value="Reset" class="panel-button-reset">
<input type="button" value="Cancel" class="panel-button-cancel">
</form>
</div>
</body>
您可以使用框架标记在另一个html表单中显示一个html表单
这是与jsPlumb功能相关还是纯粹与Javascript相关?是的。但是如何从js文件中显示它呢?可以通过使用js脚本向框架标记中注入数据来实现这一点。在我的早期版本中,属性表单位于主页面中,我使用css中的display:none属性在开始时隐藏属性面板,然后在js文件中隐藏属性面板,在将元素放到画布上后,我调用.show()函数来显示它。与此类似,我如何使用两个表单来实现这一点呢?我也得到了这一点-$(“#includecontent”).load(“Stream/StreamProperty.html”);这也很好很好,很高兴听到这个
$("#container").droppable({
accept: '.project, .query',
containment: 'container',
/**
*
* @param e --> original event object fired/ normalized by jQuery
* @param ui --> object that contains additional info added by jQuery depending on which interaction was used
* @helper clone
*/
drop: function(e, ui) {
var dropElem = ui.draggable.attr('class');
alert('drop element: ' + dropElem);
droppedElement = ui.helper.clone();
//jsPlumb doesn't support jQuery cloneUI method.
//So once the icon is dragged and dropped on the canvas, the clone UI class will be removed
ui.helper.remove();
$(droppedElement).removeAttr("class");
// repaint --> Recompute and position all the connections
jsPlumb.repaint(ui.helper);
//Add the 'pro' class which has the same styling as the 'project' class but differs in functionality
//This avoids the duplication of another project class when one project class is being dragged and dropped
if (dropElem == "project ui-draggable") {
var newAgent = $('<div>').attr('id', i).addClass('pro');
//Reset Property fields
$("#lot")[0].reset();
//Display the Properties panel when the element is Clicked
$(".toolbox-titlex").show();
$(".panel").show();
} else {
var newAgent = $('<div>').attr('id', i).addClass('que');
alert("que added");
}
//Reset Property fields
$("#lot")[0].reset();
//Display the Properties panel when the element is Clicked
$(".toolbox-titlex").show();
$(".panel").show();