⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fywvml.htm

📁 vml编辑器,用html和javscript写成,通过 在浏览器中编辑,生成vml代码
💻 HTM
📖 第 1 页 / 共 4 页
字号:
if(moveobj!=null){
if(moveobj.tagName!="line"){
if(tempx>ckleft){moveobj.style.width=tempx-ckleft}else{moveobj.style.left=tempx;moveobj.style.width=ckleft-tempx}
if(tempy>cktop){moveobj.style.height=tempy-cktop}else{moveobj.style.top=tempy;moveobj.style.height=cktop-tempy}
}else{moveobj.to=parseInt(tempx-ckleft)+","+parseInt(tempy-cktop);if(ckto=="")ckto=parseInt(tempx-ckleft)+","+parseInt(tempy-cktop);}
}
break;
case "弧型":  //弧型
if(tempx-xx<0){arc1.style.left=tempx;arc1.style.width=(xx-tempx)}else{arc1.style.width=(tempx-xx)}
if(tempy-yy<0){arc1.style.top=tempy;arc1.style.height=(yy-tempy)}else{arc1.style.height=(tempy-yy)}
break;
case "直线":  //直线
line1.to=(tempx-xx)+","+(tempy-yy)
break;
case "圆型":  //圆型
if(tempx-xx<0){oval1.style.left=tempx;oval1.style.width=(xx-tempx)}else{oval1.style.width=(tempx-xx)}
if(tempy-yy<0){oval1.style.top=tempy;oval1.style.height=(yy-tempy)}else{oval1.style.height=(tempy-yy)}
break;
case "长方型":  //长方型
if(tempx-xx<0){rect1.style.left=tempx;rect1.style.width=(xx-tempx)}else{rect1.style.width=(tempx-xx)}
if(tempy-yy<0){rect1.style.top=tempy;rect1.style.height=(yy-tempy)}else{rect1.style.height=(tempy-yy)}
break;
case "圆矩型":  //圆矩型
if(tempx-xx<0){roundrect1.style.left=tempx;roundrect1.style.width=(xx-tempx)}else{roundrect1.style.width=(tempx-xx)}
if(tempy-yy<0){roundrect1.style.top=tempy;roundrect1.style.height=(yy-tempy)}else{roundrect1.style.height=(tempy-yy)}
break;
case "旋转":  //旋转
if(moveobj!=null){moveobj.Rotation=(tempx+tempy)/2}
break;
case "高级图型":  //高级图型
if(moveobj!=null){moveobj.style.left=tempx-oldx;moveobj.style.top=tempy-oldy;}
break;
}}}
function div1.onmouseup(){
savechexiao()
document.releaseCapture();if(isok==false){forerr();return false};isok=false;menu1.style.display='none'
tempx=event.x;tempy=event.y;divwid=div1.offsetWidth;divhei=div1.offsetHeight
if(tempx>document.body.offsetWidth){forerr();return alert("X坐标越界")}
if(tempy>document.body.offsetHeight){forerr();return alert("Y坐标越界")}
if(bitext=="铅笔"&&poly1!=null){
poly1.points.value=oldvalue;oldvalue="";poly1=null;
}else if(event.srcElement.parentElement.id=="div1"&&event.button==2&&poly1==null){menu1.style.left=tempx;menu1.style.top=tempy;menu1.style.display='';thisobj=event.srcElement}
else if(event.button==2&&bitext=="记忆线"&&poly1!=null){
poly1.outerHTML="";poly1=null
}
if(event.button==1){
switch(bitext){
case "选移":  //选移
if(moveobj!=null&&parseInt(moveobj.style.left)<0&&moveobj.tagName!="polyline"){forerr();return alert("被移动物体X1超出界限")}
if(moveobj!=null&&parseInt(moveobj.style.left)+moveobj.offsetWidth-2>document.body.offsetWidth){forerr();return alert("被移动物体X2超出界限")}
if(moveobj!=null&&parseInt(moveobj.style.top)<0&&moveobj.tagName!="polyline"){forerr();return alert("被移动物体Y1超出界限")}
if(moveobj!=null&&parseInt(moveobj.style.top)+moveobj.offsetHeight-2>document.body.offsetHeight&&moveobj.tagName!="polyline"){forerr();return alert("被移动物体Y2超出界限")}
moveobj=null
break;
case "调大小":  //调大小
moveobj=null;ckto=""
break;
case "弧型":  //弧型
arc1.style.display='none';
if (Math.abs(tempx-xx)<=1||Math.abs(tempy-yy)<=1)return false
div1.appendChild(document.createElement("<v:arc startangle='"+yuanqueqidian.options[yuanqueqidian.selectedIndex].text+"' endangle='"+yuanquezhongdian.options[yuanquezhongdian.selectedIndex].text+"' style='position:absolute;z-index:"+zz+";left:"+arc1.style.left+";top:"+arc1.style.top+";width:"+arc1.style.width+";height:"+arc1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))
if(huxingtixing==false){huxingtixing=true;alert("弧型已绘出,调整弧度 startangle='' endangle='' 请使用“改源码”功能或使用旋转功能更改弧缺")}
break;
case "直线":  //直线
line1.style.display="none"
if (Math.abs(tempx-xx)<=2&&Math.abs(tempy-yy)<=2)return false
div1.appendChild(document.createElement("<v:line style='position:absolute;z-index:"+zz+";left:"+xx+";top:"+yy+";' to='"+(event.x-xx)+","+(event.y-yy)+"' strokecolor='"+color1+"' strokeweight='"+size1+"'/>"))
break;
case "圆型":  //圆型
oval1.style.display="none"
if (Math.abs(tempx-xx)<=1||Math.abs(tempy-yy)<=1)return false
div1.appendChild(document.createElement("<v:oval style='position:absolute;z-index:"+zz+";left:"+oval1.style.left+";top:"+oval1.style.top+";width:"+oval1.style.width+";height:"+oval1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))
break;
case "长方型":  //长方型
rect1.style.display="none"
if (Math.abs(tempx-xx)<=1||Math.abs(tempy-yy)<=1)return false
div1.appendChild(document.createElement("<v:rect style='position:absolute;z-index:"+zz+";left:"+rect1.style.left+";top:"+rect1.style.top+";width:"+rect1.style.width+";height:"+rect1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))
break;
case "圆矩型":  //圆矩型
roundrect1.style.display="none"
if (Math.abs(tempx-xx)<=1||Math.abs(tempy-yy)<=1)return false
div1.appendChild(document.createElement("<v:roundrect style='position:absolute;z-index:"+zz+";left:"+roundrect1.style.left+";top:"+roundrect1.style.top+";width:"+roundrect1.style.width+";height:"+roundrect1.style.height+";' strokecolor='"+color1+"' strokeweight='"+size1+"' fillcolor='"+color2+"'/>"))
break;
case "填充":  //填充
if(event.srcElement.parentElement.id=="div1"){
if(!usejianbian.checked){event.srcElement.fillcolor=tianchongbeijing.value}else{
temp1=jianbianyangshi[0].checked?'gradient':'gradientradial'
temp2=event.srcElement.innerHTML.replace(/<v\:fill .*<\/v:fill>/gi,'')
event.srcElement.innerHTML=temp2+"<v:fill color='"+jianbianse2.value+"' color2='"+jianbianse1.value+"' type='"+temp1+"'/>"
}}
break;
case "立体":  //立体
if(event.srcElement.parentElement.id=="div1"){
temp2=event.srcElement.innerHTML.replace(/<v\:extrusion .*<\/v:extrusion>/gi,'')
event.srcElement.innerHTML=temp2+"<v:Extrusion on='t' color='"+litiyanse.value+"' backdepth='"+houxiangshenzhan.options[houxiangshenzhan.selectedIndex].text+"' foredepth='"+qianxiangshenzhan.options[qianxiangshenzhan.selectedIndex].text+"' rotationangle='"+pianyishangbian.options[pianyishangbian.selectedIndex].text+","+pianyizuobian.options[pianyizuobian.selectedIndex].text+"'/>"
}
break;
case "边框":  //边框
if(event.srcElement.parentElement.id=="div1"){
temp2=event.srcElement.innerHTML.replace(/<v\:stroke .*<\/v:stroke>/gi,'')
event.srcElement.innerHTML=temp2+"<v:Stroke dashstyle='"+biankuangyangshi.options[biankuangyangshi.selectedIndex].text+"' startarrow='"+qidianjiantou.options[qidianjiantou.selectedIndex].text+"' endarrow='"+zhongdianjiantou.options[zhongdianjiantou.selectedIndex].text+"'/>"
event.srcElement.strokecolor=biankuangyanse.value
biankuangcudu.options[biankuangcudu.selectedIndex].text=='0'?event.srcElement.stroked=false:event.srcElement.strokeweight=biankuangcudu.options[biankuangcudu.selectedIndex].text
}
break;
case "改源码":  //改源码
if(event.srcElement.parentElement.id=="div1"){
gaojiobj=event.srcElement
txt2.value=event.srcElement.outerHTML.replace(/>/g,">\n").replace(/ = /g,"=").replace(/\: /g,":").replace(/\; /g,";");gaoji1.style.left=event.x;gaoji1.style.top=event.y;gaoji1.style.display=''
}
break;
case "文字化":  //文字化
if(event.srcElement.parentElement.id=="div1"){
str1=prompt("请输入一段用于图型轨迹填充的文字(如果您的VML插件版本过低,中文可能无法显示)","")
if(!str1)return false;if(str1=='')return false
if(str1.indexOf("'")!=-1)return alert("输入的文字中不可含有违禁符号 ' 单引号")
temp2=event.srcElement.innerHTML.replace(/<v\:path .*<\/v:path>/gi,'').replace(/<v\:textpath .*<\/v:textpath>/gi,'')
event.srcElement.innerHTML=temp2+"<v:fill on='true' color='"+wenziyanse2.value+"'/><v:path textpathok='True'/>\n<v:textpath on='True' style='font-size:"+wenzidaxiao2.options[wenzidaxiao2.selectedIndex].text+"px;font-family:"+ziti2.options[ziti2.selectedIndex].text+";' string='"+str1+"'/>"
}
break;
case "阴影":  //阴影
if(event.srcElement.parentElement.id=="div1"){
temp2=event.srcElement.innerHTML.replace(/<v\:shadow .*<\/v:shadow>/gi,'')
event.srcElement.innerHTML=temp2+"<v:shadow offset='"+zuoyoupianyi.options[zuoyoupianyi.selectedIndex].text+"px,"+shangxiapianyi.options[shangxiapianyi.selectedIndex].text+"px' color='"+yinyingyanse.value+"' on='true'/>"
}
break;
case "透明度":  //透明度
if(event.srcElement.parentElement.id=="div1"){
if(bantouming(0).checked==true){
event.srcElement.filled=true
event.srcElement.style.filter="alpha(opacity="+toumingxishu.options[toumingxishu.selectedIndex].text+",style="+toumingyangshi.options[toumingyangshi.selectedIndex].value+")"
}else{event.srcElement.style.filter="";event.srcElement.filled=false}
}
break;
case "放大":  //放大
if(event.srcElement.parentElement.id=="div1")fangda(event.srcElement)
break;
case "缩小":  //缩小
if(event.srcElement.parentElement.id=="div1")suoxiao(event.srcElement)
break;
case "旋转":  //旋转

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -