在iframe中实现对层的拖动?
<tablecellspacing="1"cellpadding="4"width="100%"align="center"border="0"><textarearow...
<table cellspacing="1" cellpadding="4" width="100%" align="center" border="0">
<textarea rows="" cols="" id="textbox" style="display: none;"><div id=ccc style=position:absolute;left:230;top:20;width:200;height:100;background:#aa00ee;cursor:move;Z-INDEX:333;>asdfas</div> </textarea>
<table style="width:100%;height: 500px;" border="0">
<tr>
<td style="width: 100%; height: 100%;">
<iframe id="textbox_Editor" name="textbox_Editor" width="100%" height="100%" style="border-right: 1px solid #00aaff;border-left: 1px solid #00aaff;border-top: 1px solid #00aaff;border-bottom: 1px solid #00aaff;">
</iframe>
</td>
</tr>
</table>
</table>
<script type="text/javascript">
//<![CDATA[
FTB_Initialize('textbox');
function FTB_Initialize(ftbName) { //初始化
hiddenHtml = FTB_GetHiddenField(ftbName);
editor = FTB_GetIFrame(ftbName);
editor.document.open();
editor.document.write(hiddenHtml.value);
editor.document.close();
}
function FTB_CopyHtmlToHidden(ftbName) { // 复制到隐藏域
hiddenHtml = FTB_GetHiddenField(ftbName);
editor = FTB_GetIFrame(ftbName);
hiddenHtml.value = editor.document.body.innerHTML;
}
function FTB_GetHiddenField(ftbName) {
return document.getElementById(ftbName);
}
function FTB_GetIFrame(ftbName) {
return eval(ftbName + "_Editor");
//return document.getElementById(ftbName + "_Editor");
}
//]]>>
</script> 展开
<textarea rows="" cols="" id="textbox" style="display: none;"><div id=ccc style=position:absolute;left:230;top:20;width:200;height:100;background:#aa00ee;cursor:move;Z-INDEX:333;>asdfas</div> </textarea>
<table style="width:100%;height: 500px;" border="0">
<tr>
<td style="width: 100%; height: 100%;">
<iframe id="textbox_Editor" name="textbox_Editor" width="100%" height="100%" style="border-right: 1px solid #00aaff;border-left: 1px solid #00aaff;border-top: 1px solid #00aaff;border-bottom: 1px solid #00aaff;">
</iframe>
</td>
</tr>
</table>
</table>
<script type="text/javascript">
//<![CDATA[
FTB_Initialize('textbox');
function FTB_Initialize(ftbName) { //初始化
hiddenHtml = FTB_GetHiddenField(ftbName);
editor = FTB_GetIFrame(ftbName);
editor.document.open();
editor.document.write(hiddenHtml.value);
editor.document.close();
}
function FTB_CopyHtmlToHidden(ftbName) { // 复制到隐藏域
hiddenHtml = FTB_GetHiddenField(ftbName);
editor = FTB_GetIFrame(ftbName);
hiddenHtml.value = editor.document.body.innerHTML;
}
function FTB_GetHiddenField(ftbName) {
return document.getElementById(ftbName);
}
function FTB_GetIFrame(ftbName) {
return eval(ftbName + "_Editor");
//return document.getElementById(ftbName + "_Editor");
}
//]]>>
</script> 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询