| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 718 人关注过本帖
标题:这串代码如何实现IE6以上版本的兼容?
只看楼主 加入收藏
jiwenrui
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-6-16
结帖率:0
收藏
已结贴  问题点数:20 回复次数:1 
这串代码如何实现IE6以上版本的兼容?

<head>
<title>在线文本编辑器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.yToolbar
{
}
TABLE.Toolbar
{
    BORDER-RIGHT: #F8FCF8 1px solid;
}
TABLE.Toolbar TD
{
    BACKGROUND-COLOR: buttonface;
    BORDER-BOTTOM: #808080    1px solid;
    BORDER-RIGHT: #808080 1px solid;
    BORDER-TOP:    #F8FCF8    1px solid;
    HEIGHT: 27px;
    LEFT: 0px;
    POSITION: relative;
    TOP: 0px;
}
.Btn
{
    BACKGROUND-COLOR: buttonface;
    BORDER-BOTTOM: buttonface 1px solid;
    BORDER-LEFT: buttonface 1px    solid;
    BORDER-RIGHT: buttonface 1px solid;
    BORDER-TOP:    buttonface 1px solid;
    HEIGHT: 23px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH: 23px;
}
.TBSep
{
    BORDER-LEFT: #808080 1px solid;
    BORDER-RIGHT: #F8FCF8 1px solid;
    FONT-SIZE: 0px;
    HEIGHT: 22px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH:1px
}
.TBGen
{
    FONT: 8pt arial,sans-serif;
    HEIGHT: 22px;
    POSITION: absolute;
    TOP: 2px
}
.TBHandle
{
    BACKGROUND-COLOR: buttonface;
    BORDER-LEFT: #F8FCF8 1px solid;
    BORDER-RIGHT: #808080 1px solid;
    BORDER-TOP:    #F8FCF8    1px solid;
    FONT-SIZE: 1px;
    HEIGHT: 22px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH: 3px
}
.Ico
{
    HEIGHT: 22px;
    LEFT: -1px;
    POSITION: absolute;
    TOP: -1px;
    WIDTH: 22px
}
.BtnMouseOverUp
{
    BACKGROUND-COLOR: #B5BED6;
    BORDER-BOTTOM: #08246B    1px solid;
    BORDER-LEFT: #08246B 1px solid;
    BORDER-RIGHT: #08246B 1px solid;
    BORDER-TOP:    #08246B    1px solid;
    HEIGHT: 23px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH: 24px
}
.BtnMouseOverDown
{
    BACKGROUND-COLOR: #8492B5;
    BORDER-BOTTOM: #08246B 1px solid;
    BORDER-LEFT: #08246B 1px solid;
    BORDER-RIGHT: #08246B 1px solid;
    BORDER-TOP:    #08246B 1px solid;
    HEIGHT: 23px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH: 24px
}
.BtnDown
{
    BACKGROUND-COLOR: #DCDCDC;
    BORDER-BOTTOM: #F8FCF8 1px solid;
    BORDER-LEFT: #808080 1px solid;
    BORDER-RIGHT: #F8FCF8 1px solid;
    BORDER-TOP:    #808080 1px solid;
    HEIGHT: 23px;
    POSITION: absolute;
    TOP: 1px;
    WIDTH: 24px
}
.IcoDown
{
    HEIGHT: 23px;
    LEFT: 0px;
    POSITION: absolute;
    TOP: 0px;
    WIDTH: 24px
}
.IcoDownPressed
{
    LEFT: 1px;
    POSITION: absolute;
    TOP: 1px
}

BODY
{
    BACKGROUND-COLOR:#FFFFFF;
    MARGIN: 0px;
    PADDING: 0px;
}
SELECT
{
    BACKGROUND: #eeeeee;
    FONT: 8pt verdana,arial,sans-serif
}
TABLE
{
    POSITION: relative
}
.Composition
{
    BACKGROUND-COLOR: #cccccc;
    POSITION: relative
}
</style>
<script language="Javascript" src="include/editor.js"></script>
<script language="Javascript">
var bEditMode=true;
var sCurrMode = "EDIT";
var bodyTag = "<head><style type=\"text/css\">body,a,table,div,span,td,th,input,select{font-size:12px;font-family:\"宋体,Verdana,Arial\";color:#000000;}</style><meta http-equiv=Content-Type content=\"text/html; charset=gb2312\"></head><body bgcolor=\"#FFFFFF\" MONOSPACE>" ;
var sContentName = "Content" ;
var objContent = parent.document.getElementsByName(sContentName)[0];

// 全局设置对象
var config = new Object() ;
config.AutoDetectPasteFromWord = true;
</script>
<script language="javascript" event="onerror(msg, url, line)" for="window">
return true ;     // 隐藏错误
</script>
</head>
<body scrolling="no" oncontextmenu="event.returnValue=false;" onFocus="VerifyFocus()">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
    <tr>
        <td id="Editor_Tool">
        <table border="0" cellpadding="0" cellspacing="0" width="100%" class="Toolbar">
            <tr>
                <td>
                <div class="yToolbar">
                    <div class="TBHandle">
                    </div>
                    <select class="TBGen" onChange="format('FormatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
                    <option selected>段落样式</option>
                    <option value="&lt;P&gt;">普通</option>
                    <option value="&lt;H1&gt;">标题一</option>
                    <option value="&lt;H2&gt;">标题二</option>
                    <option value="&lt;H3&gt;">标题三</option>
                    <option value="&lt;H4&gt;">标题四</option>
                    <option value="&lt;H5&gt;">标题五</option>
                    <option value="&lt;H6&gt;">标题六</option>
                    <option value="&lt;p&gt;">段落</option>
                    <option value="&lt;dd&gt;">定义</option>
                    <option value="&lt;dt&gt;">术语定义</option>
                    <option value="&lt;dir&gt;">目录列表</option>
                    <option value="&lt;menu&gt;">菜单列表</option>
                    <option value="&lt;PRE&gt;">已编排格式</option>
                    </select><select class="TBGen" onChange="format('fontsize',this[this.selectedIndex].value);this.selectedIndex=0">
                    <option selected>字号</option>
                    <option value="7">一号</option>
                    <option value="6">二号</option>
                    <option value="5">三号</option>
                    <option value="4">四号</option>
                    <option value="3">五号</option>
                    <option value="2">六号</option>
                    <option value="1">七号</option>
                    </select><div class="TBSep">
                    </div>
                    <div class="Btn" title="字体颜色" onClick="ShowDialog('dialog/selcolor.htm?action=forecolor', 280, 250, true)">
                        <img class="Ico" src="Images/edit/forecolor.gif"></div>
                    <div class="Btn" title="字体背景颜色" onClick="ShowDialog('dialog/selcolor.htm?action=backcolor', 280, 250, true)">
                        <img class="Ico" src="Images/edit/backcolor.gif"></div>
                    <div class="Btn" title="对象背景颜色" onClick="ShowDialog('dialog/selcolor.htm?action=bgcolor', 280, 250, true)">
                        <img class="Ico" src="Images/edit/bgcolor.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="剪切" onClick="format('cut')">
                        <img class="Ico" src="Images/edit/cut.gif"></div>
                    <div class="Btn" title="复制" onClick="format('copy')">
                        <img class="Ico" src="Images/edit/copy.gif"></div>
                    <div class="Btn" title="纯文本粘贴" onClick="PasteText()">
                        <img class="Ico" src="Images/edit/pastetext.gif"></div>
                    <div class="Btn" title="从Word中粘贴" onClick="PasteWord()">
                        <img class="Ico" src="Images/edit/pasteword.gif"></div>
                    <div class="Btn" title="删除" onClick="format('delete')">
                        <img class="Ico" src="Images/edit/delete.gif"></div>
                    <div class="Btn" title="删除文字格式" onClick="format('RemoveFormat')">
                        <img class="Ico" src="Images/edit/RemoveFormat.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="撤消" onClick="format('undo')">
                        <img class="Ico" src="Images/edit/undo.gif"></div>
                    <div class="Btn" title="恢复" onClick="format('redo')">
                        <img class="Ico" src="Images/edit/redo.gif"></div>
                    <div class="Btn" title="全部选中" onClick="format('SelectAll')">
                        <img class="Ico" src="Images/edit/selectAll.gif"></div>
                    <div class="Btn" title="取消选择" onClick="format('Unselect')">
                        <img class="Ico" src="Images/edit/unselect.gif"></div>
                    <div class="Btn" title="插入特殊字符" onClick="ShowDialog('dialog/symbol.htm', 350,220, true)"><img class="Ico" src="Images/edit/symbol.gif"></div>
                    <div class="Btn" title="代码样式" onClick="insert('code')">
                        <img class="Ico" src="Images/edit/code.gif"></div>
<div class="Btn" title="插入其他文件" onClick="ShowDialog('dialog/file.htm', 350, 125, true)">
                        <img class="Ico" src="Images/edit/file.gif"></div>
<div class="Btn" title="插入自动播放的媒体文件" onClick="ShowDialog('dialog/media.htm', 350, 185, true)">
                    <img class="Ico" src="Images/edit/Media.gif"></div>

                    
                </div>
                </td>
            </tr>
            <tr>
                <td>
                <div class="yToolbar">

                    <div class="Btn" title="粗体" onClick="format('bold')">
                        <img class="Ico" src="Images/edit/bold.gif"></div>
                    <div class="Btn" title="斜体" onClick="format('italic')">
                        <img class="Ico" src="Images/edit/italic.gif"></div>
                    <div class="Btn" title="下划线" onClick="format('underline')">
                        <img class="Ico" src="Images/edit/underline.gif"></div>
                    <div class="Btn" title="中划线" onClick="format('StrikeThrough')">
                        <img class="Ico" src="Images/edit/strikethrough.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="左对齐" onClick="format('justifyleft')">
                        <img class="Ico" src="Images/edit/JustifyLeft.gif"></div>
                    <div class="Btn" title="居中对齐" onClick="format('justifycenter')">
                        <img class="Ico" src="Images/edit/JustifyCenter.gif"></div>
                    <div class="Btn" title="右对齐" onClick="format('justifyright')">
                        <img class="Ico" src="Images/edit/JustifyRight.gif"></div>
                    <div class="Btn" title="两端对齐" onClick="format('JustifyFull')">
                        <img class="Ico" src="Images/edit/JustifyFull.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="编号" onClick="format('insertorderedlist')">
                        <img class="Ico" src="Images/edit/insertorderedlist.gif"></div>
                    <div class="Btn" title="项目符号" onClick="format('insertunorderedlist')">
                        <img class="Ico" src="Images/edit/insertunorderedlist.gif"></div>
                    <div class="Btn" title="增加缩进量" onClick="format('indent')">
                        <img class="Ico" src="Images/edit/indent.gif"></div>
                    <div class="Btn" title="减少缩进量" onClick="format('outdent')">
                        <img class="Ico" src="Images/edit/outdent.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="上标" onClick="format('superscript')">
                        <img class="Ico" src="Images/edit/superscript.gif"></div>
                    <div class="Btn" title="下标" onClick="format('subscript')">
                        <img class="Ico" src="Images/edit/subscript.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="插入或修改表格" onClick="ShowDialog('dialog/table.htm', 350, 335, true)">
                        <img class="Ico" src="Images/edit/table.gif"></div>
                    <div class="Btn" title="插入或修改栏目框" onClick="ShowDialog('dialog/fieldset.htm', 350, 185, true)">
                        <img class="Ico" src="Images/edit/fieldset.gif"></div>
                    <div class="Btn" title="插入或修改网页帧" onClick="ShowDialog('dialog/iframe.htm', 350, 205, true)">
                        <img class="Ico" src="Images/edit/iframe.gif"></div>
                    <div class="Btn" title="插入水平尺" onClick="format('InsertHorizontalRule')">
                        <img class="Ico" src="Images/edit/InsertHorizontalRule.gif"></div>
                    <div class="Btn" title="插入或修改字幕" onClick="ShowDialog('dialog/marquee.htm', 395, 150, true)">
                        <img class="Ico" src="Images/edit/Marquee.gif"></div>
                    <div class="TBSep">
                    </div>
                    <div class="Btn" title="插入或修改超级链接" onClick="format('CreateLink')">
                        <img class="Ico" src="Images/edit/CreateLink.gif"></div>
                    <div class="Btn" title="取消超级链接或标签" onClick="format('UnLink')">
                        <img class="Ico" src="Images/edit/Unlink.gif"></div>
                    <div class="Btn" title="插入或修改图片" onClick="ShowDialog('dialog/img.htm', 350, 290, true)">
                        <img class="Ico" src="Images/edit/img.gif"></div>
                    <div class="Btn" title="插入Flash动画" onClick="ShowDialog('dialog/flash.htm', 350, 185, true)">
                        <img class="Ico" src="Images/edit/flash.gif"></div>
                </div>
                </td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td height="100%">
        <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100%">
            <tr>
                <td height="100%"><input type="hidden" id="ContentEdit" value>
                <input type="hidden" id="ContentLoad" value>
                <input type="hidden" id="ContentFlag" value="0">
                <iframe class="Composition" id="Editor" marginheight="1" marginwidth="1" width="100%" height="100%" scrolling="yes">
                </iframe></td>
            </tr>
        </table>
        </td>
    </tr>
    <tr>
        <td height="20" valign="top">
        <table border="0" cellpadding="0" cellspacing="0" width="100%">
            <tr>
                <td align="left" valign="top" id="Editor_CODE" style="display:none">
                <map name="Editor_Map1">
                <area shape="polygon" coords="50, 1, 46, 7, 50, 14, 90, 14, 95, 2" alt="编辑状态" onClick="setMode('EDIT')">
                <area shape="polygon" coords="128, 13, 134, 0, 96, 0, 93, 10, 96, 14" alt="预览状态" onClick="setMode('VIEW')">
                </map>
                <img src="Images/edit/modecode.gif" style="cursor:hand" height="15" width="135" usemap="#Editor_Map1" border="0"></td>
                <td align="left" valign="top" id="Editor_EDIT">
                <map name="Editor_Map2">
                <area shape="polygon" coords="5, 3, 12, 14, 43, 14, 49, 6, 43, 0" alt="代码状态" onClick="setMode('CODE')">
                <area shape="polygon" coords="97, 0, 94, 7, 98, 14, 127, 14, 134, 0" alt="预览状态" onClick="setMode('VIEW')">
                </map>
                <img src="Images/edit/modeedit.gif" style="cursor:hand" height="15" width="135" usemap="#Editor_Map2" border="0"></td>
                <td align="left" valign="top" id="Editor_VIEW" style="display:none">
                <map name="Editor_Map3">
                <area shape="polygon" coords="3, 2, 10, 14, 41, 14, 50, 0" alt="代码状态" onClick="setMode('CODE')">
                <area shape="polygon" coords="87, 14, 91, 5, 87, 0, 50, 0, 46, 9, 49, 14" alt="编辑状态" onClick="setMode('EDIT')">
                </map>
                <img src="Images/edit/modepreview.gif" style="cursor:hand" height="15" width="135" usemap="#Editor_Map3" border="0"></td>
            </tr>
        </table>
        </td>
    </tr>
</table>
<div id="divTemp" style="VISIBILITY: hidden; OVERFLOW: hidden; POSITION: absolute; WIDTH: 1px; HEIGHT: 1px"></div>
</body>
搜索更多相关主题的帖子: relative content 编辑器 style title 
2013-06-16 19:01
Aviva_Wang
Rank: 11Rank: 11Rank: 11Rank: 11
来 自:苏州
等 级:贵宾
威 望:26
帖 子:701
专家分:2382
注 册:2013-3-12
收藏
得分:20 
教一个最笨的方法,把这段代码放到IE6.0以上的浏览器中查看,哪边有变形的,就修改哪边的代码

asp
2013-06-17 16:39
快速回复:这串代码如何实现IE6以上版本的兼容?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.036150 second(s), 9 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved