网乐原科技

直播中

news center新闻中心
首页 > 资讯中心 > 软件技术

一个QQ菜单编辑器!

发布时间:2008-12-19     阅读数: 次       来源:网乐原科技
CreateCode <script language="javascript"> //生成代码 function createCode() { totalheight = parseInt(fcreate.bodyheight.value) + fcreate.headheight.value * (fcreate.itemcount.value - 1); textCode.value = text1.value + "var headHeight = " + fcreate.headheight.value + ";" + "var bodyHeight = " + fcreate.bodyheight.value + ";" + "var objcount = " + fcreate.itemcount.value + ";" + "var step = " + fcreate.mspeed.value + ";" + text2.value + ".headtd1 { background: #" + fcreate.headcolorn.value + "; border: 2px outset; border-color: #" + fcreate.lbordern.value + " #" + fcreate.dbordern.value + " #" + fcreate.dbordern.value + " #" + fcreate.lbordern.value + "; cursor: hand; font-size: 9pt}" + ".headtd2 { background: #" + fcreate.headcolora.value + "; border: 2px outset; border-color: #" + fcreate.lbordera.value + " #" + fcreate.dbordera.value + " #" + fcreate.dbordera.value + " #" + fcreate.lbordera.value + "; cursor: hand; font-size: 9pt}" + ".bodytd { background: #" + fcreate.bodycolor.value + "; border: 2px outset; border-color: #" + fcreate.lborderb.value + " #" + fcreate.dborderb.value + " #" + fcreate.dborderb.value + " #" + fcreate.lborderb.value + "; font-size: 9pt}" + text3.value + "
"; itemtop = 0; for (i = 1; i <= parseInt(fcreate.itemcount.value); i++) { textCode.value += "
" + "" + "" + ""+ "" + "" + "" + "" + "
"; //textCode.value += getValue("fcreate.item" + i); textCode.value +=document.all["item"+i].value+"
" + "test" + "
" + "
"; if (i == 1) itemtop += parseInt(fcreate.bodyheight.value); else itemtop += parseInt(fcreate.headheight.value); } textCode.value += "
" } //获取对象的值 function getValue(obj) { //obj = Object(obj); return obj.value; } //清空代码 function clearCode() { textCode.value = ""; } //预览代码 function prevCode() { createCode(); open().document.write(textCode.value); } //选择代码 function selectCode() { textCode.select(); } //根据输入的数字,自动生成子菜单的填写项 function checkItems() { if ((fcreate.itemcount.value.length > 0 && isNaN(fcreate.itemcount.value)) || fcreate.itemcount.value.length == 0) { alert("请输入数字!"); fcreate.itemcount.focus(); } else { if (fcreate.itemcount.value > 50) { alert("太夸张了吧,小一点呀,不用这么玩命吧!(50以下,含50)") fcreate.itemcount.focus(); return; } if (fcreate.itemcount.value < 1) { alert("太夸张了吧,一个不要你要做什么!(1以上,含1)") fcreate.itemcount.focus(); return; } itemtext = ""; for (i = 1; i <= fcreate.itemcount.value; i++) { itemtext += ""+ "" + "" + "" + "" + ""; } itemtext+="
菜单项目"+i+"" + " " + "菜 单 项 目 内 容 网 页" + " " + "
" document.all.itemmenu.innerHTML = itemtext; } } //检查是否是一个合法的颜色数值 function changebkclr(obj) { hexv = new Array("0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"); flag = false; if (obj.value.length != 6) { alert("请用正确填写!(六位数)"); obj.focus(); } else { for (i = 0; i < 6; i++) { for (j = 0; j <16; j++) if (obj.value.charAt(i).toLowerCase() == hexv[j]) flag = true; if (!flag) { alert("请用十六进制填写。(0-9,a-f)"); obj.focus(); return; } flag = false; } obj.style.background=obj.value; } } //检查是否是一个合法的数字 function checknum(obj) { if (isNaN(obj.value)) { alert("请输入数字!"); obj.focus(); return; } } //检查改变数值的速度合法性 function changespd(obj) { fcreate.mspeed.value = 1; } //检查是否是一个合法的速度 function checkspeed(obj) { if (isNaN(obj.value)) { alert("请输入数字!"); obj.focus(); } else { if ((obj.form.bodyheight.value - obj.form.headheight.value)%obj.value != 0) { alert("请确认可以被 “菜单体高度 - 菜单题头高度” 整除"); obj.focus(); } } } //控制总题目的填写 function ctrltitle(obj) { if (obj.value == "有") obj.form.titlename.disabled = false; else obj.form.titlename.disabled = true; } </script>

菜单项目个数 菜单题头高度 菜单体高度 填写移动速度
一 般 题 头 颜 色 亮 边 颜 色 暗 边 颜 色
当 前 题 头 颜 色 亮 边 颜 色 暗 边 颜 色
菜 单 主 体 颜 色 亮 边 颜 色 暗 边 颜 色
菜单 总题目 题目名称
菜单项目1 菜 单 项 目 内 容 网 页
菜单项目2 菜 单 项 目 内 容 网 页

网乐原科技

客服热线:0771-5761507

QQ:53290011

QQ邮箱:53290011@qq.com

工作时间:周一到周五 9:00-18:00

地址:广西南宁市江南万达写字楼C16栋1309室

物联网开发

关注我们

微信小商店 腾讯QQ客服 微信客服