| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 774 人关注过本帖
标题:[求助] javascript实现像文本一样的菜单栏
取消只看楼主 加入收藏
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
 问题点数:0 回复次数:2 
[求助] javascript实现像文本一样的菜单栏

ocument.write('<style type="text/css">\n'); document.write('.btn { width: 22px; height: 22px; border: 1px solid buttonface; margin: 0; padding: 0; }\n'); document.write('.btnOver { width: 22px; height: 22px; border: 1px outset; }\n'); document.write('.btnDown { width: 22px; height: 22px; border: 1px inset; background-color: buttonhighlight; }\n'); document.write('.btnNA { width: 22px; height: 22px; border: 1px solid buttonface; filter: alpha(opacity=25); }\n'); document.write('.cMenu { background-color: threedface; color: menutext; cursor: Default; font-family: MS Sans Serif; font-size: 8pt; padding: 2 12 2 16; }'); document.write('.cMenuOver { background-color: highlight; color: highlighttext; cursor: Default; font-family: MS Sans Serif; font-size: 8pt; padding: 2 12 2 16; }'); document.write('.cMenuDivOuter { background-color: threedface; height: 9 }'); document.write('.cMenuDivInner { margin: 0 4 0 4; border-width: 1; border-style: solid; border-color: threedshadow threedhighlight threedhighlight threedshadow; }'); document.write('</style>\n');

/* ---------------------------------------------------------------------- * Function : editor_defaultConfig Description : default configuration settings for wysiwyg editor \* ---------------------------------------------------------------------- */

function editor_defaultConfig(objname) {

this.version = "2.03"

this.width = "auto"; this.height = "auto"; this.bodyStyle = 'background-color: #FFFFFF; font-family: "Verdana"; font-size: x-small;'; this.imgURL = _editor_url + 'images/'; this.debug = 0;

this.replaceNextlines = 0; // replace nextlines from spaces (on output) this.plaintextInput = 0; // replace nextlines with breaks (on input)

this.toolbar = [ ['fontname'], ['fontsize'], // ['fontstyle'], // ['linebreak'], ['bold','italic','underline','separator'], // ['strikethrough','subscript','superscript','separator'], ['justifyleft','justifycenter','justifyright','separator'], ['OrderedList','UnOrderedList','Outdent','Indent','separator'], ['forecolor','backcolor','separator'], ['HorizontalRule','Createlink','InsertImage','InsertTable','htmlmode','separator'], // ['custom1','custom2','custom3','separator'], ['popupeditor','about']];

this.fontnames = { "仿宋_GB2312": "仿宋_GB2312", "宋体": "宋体", "黑体": "黑体", "幼圆": "幼圆", "华文楷体": "华文楷体", "华文隶书": "华文隶书", "华文行楷": "华文行楷", "华文琥珀": "华文琥珀", "华文仿宋": "华文仿宋", "Arial": "arial, helvetica, sans-serif", "Courier New": "courier new, courier, mono", "Georgia": "Georgia, Times New Roman, Times, Serif", "Tahoma": "Tahoma, Arial, Helvetica, sans-serif", "Times New Roman": "times new roman, times, serif", "Verdana": "Verdana, Arial, Helvetica, sans-serif", "impact": "impact", "WingDings": "WingDings"};

this.fontsizes = { "1 (8 pt)": "1", "2 (10 pt)": "2", "3 (12 pt)": "3", "4 (14 pt)": "4", "5 (18 pt)": "5", "6 (24 pt)": "6", "7 (36 pt)": "7" };

//this.stylesheet = "http://www.domain.com/sample.css"; // full URL to stylesheet

this.fontstyles = [ // make sure these exist in the header of page the content is being display as well in or they won't work! // { name: "headline", className: "headline", classStyle: "font-family: arial black, arial; font-size: 28px; letter-spacing: -2px;" }, // { name: "arial red", className: "headline2", classStyle: "font-family: arial black, arial; font-size: 12px; letter-spacing: -2px; color:red" }, // { name: "verdana blue", className: "headline4", classStyle: "font-family: verdana; font-size: 18px; letter-spacing: -2px; color:blue" }, ];

this.btnList = { // buttonName: commandID, title, onclick, image, "bold": ['Bold', '加粗', 'editor_action(this.id)', 'ed_format_bold.gif'], "italic": ['Italic', '斜体', 'editor_action(this.id)', 'ed_format_italic.gif'], "underline": ['Underline', '下划线', 'editor_action(this.id)', 'ed_format_underline.gif'], "strikethrough": ['StrikeThrough', '删除线', 'editor_action(this.id)', 'ed_format_strike.gif'], "subscript": ['SubScript', '脚码', 'editor_action(this.id)', 'ed_format_sub.gif'], "superscript": ['SuperScript', '首码', 'editor_action(this.id)', 'ed_format_sup.gif'], "justifyleft": ['JustifyLeft', '居左', 'editor_action(this.id)', 'ed_align_left.gif'], "justifycenter": ['JustifyCenter', '局中', 'editor_action(this.id)', 'ed_align_center.gif'], "justifyright": ['JustifyRight', '局右', 'editor_action(this.id)', 'ed_align_right.gif'], "orderedlist": ['InsertOrderedList', '编号', 'editor_action(this.id)', 'ed_list_num.gif'], "unorderedlist": ['InsertUnorderedList', '项目符号', 'editor_action(this.id)', 'ed_list_bullet.gif'], "outdent": ['Outdent', '减少缩进量', 'editor_action(this.id)', 'ed_indent_less.gif'], "indent": ['Indent', '增大缩进量', 'editor_action(this.id)', 'ed_indent_more.gif'], "forecolor": ['ForeColor', '前景色', 'editor_action(this.id)', 'ed_color_fg.gif'], "backcolor": ['BackColor', '背景色', 'editor_action(this.id)', 'ed_color_bg.gif'], "horizontalrule": ['InsertHorizontalRule', '横线', 'editor_action(this.id)', 'ed_hr.gif'], "createlink": ['CreateLink', '链接', 'editor_action(this.id)', 'ed_link.gif'], "insertimage": ['InsertImage', '图像', 'editor_action(this.id)', 'ed_image.gif'], "inserttable": ['InsertTable', '表格', 'editor_action(this.id)', 'insert_table.gif'], "htmlmode": ['HtmlMode', '可视化编辑/源码查看', 'editor_setmode(\''+objname+'\')', 'ed_html.gif'], "popupeditor": ['popupeditor', '全屏', 'editor_action(this.id)', 'fullscreen_maximize.gif'], "about": ['about', '关于', 'editor_about(\''+objname+'\')', 'ed_about.gif'],

// Add custom buttons here: "custom1": ['custom1', '系统分页符', 'editor_action(this.id)', 'ed_split_page.gif'], "custom2": ['custom2', '横线', 'editor_action(this.id)', 'ed_hr.gif'], "custom3": ['custom3', 'Purpose of button 3', 'editor_action(this.id)', 'ed_custom.gif'], // end: custom buttons

"help": ['showhelp', 'Help using editor', 'editor_action(this.id)', 'ed_help.gif']};

} 请大家帮我解释一下这代码意思(着重讲一下图片的实现过程)。。。

搜索更多相关主题的帖子: javascript 文本 菜单 
2005-06-13 11:42
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
谁有在线编辑器的源代码急急!!!!大家帮帮忙啊
2005-06-13 17:35
she151
Rank: 1
等 级:新手上路
帖 子:38
专家分:0
注 册:2005-6-7
收藏
得分:0 
谢谢你啊!
2005-06-16 02:11
快速回复:[求助] javascript实现像文本一样的菜单栏
数据加载中...
 
   



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

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