使用wode另存为web页的功能 XML 相关

2009-03-30 19:09:40 作者:ASP编程 来源:电脑高手哦 浏览次数:0 网友评论 0

    使用wode另存为web页的功能,都会出现类似下列的结构              <p class=MsoNormal align=center style='text-align:center'>              <span lang=EN-US>              <!--[if gte vml 1]>            ...
使用wode另存为web页的功能,都会出现类似下列的结构
<p class=MsoNormal align=center style='text-align:center'>
<span lang=EN-US>
<!--[if gte vml 1]>
<v:shape id="_x0000_i1040" type="#_x0000_t75" style='width:290.25pt;height:86.25pt'>
<v:imagedata src=/uploadfile/wangluo_anquan/uploadfile/200903/20090330070940446.png" o:title="W143"/>
</v:shape>
<![endif]-->
<![if !vml]>
<img onclick="fangda_x(this)" width=387 height=115 src=/uploadfile/wangluo_anquan/uploadfile/200903/20090330070942146.jpg" v:shapes="_x0000_i1040">
<![endif]>
</span>
</p>
其中:
<!--[if gte vml 1]> 若支持vml
<![endif]-->
<![if !vml]> 若不支持vml
<![endif]>
注:vml是w3c组织的平面矢量图标准,目前ws对其支持不力,但在office及word中对其有所扩展。

使用时必须有下面的声明
<html xmlns:v="urn:schemas-microsoft-com:vml"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:w="urn:schemas-microsoft-com:office:word"
xmlns="http://www.w3.org/tr/rec-html40">
<head>
<style>
v\:* {behavior:url(#default#vml);}
o\:* {behavior:url(#default#vml);}
w\:* {behavior:url(#default#vml);}
.shape {behavior:url(#default#vml);}
</style>

在你的应用中,由于只对img标签进行了处理,而未对支持vml的情况进行加工,所以就会出现你所遇到的情况。

解决的办法有二:
1。去处所有与vml相关的内容。优点是体积变小,缺点是有可能造成显示格式的变化
2。对vml相关部分增加相应处理。优点是修改量小,确保样式,缺点是体积增大

在js文件中增加一个函数

function fangda(the) {
var x_x=parseInt(the.style.width);
var y_x=parseInt(the.style.height);
var i_x=1.2;
if (event.ctrlKey) {
x_x=x_x/i_x;
y_x=y_x/i_x;
}else {
x_x=x_x*i_x;
y_x=y_x*i_x;
}
the.style.width=x_x;
the.style.height=y_x;
}

对html文档的对应部分加入事件处理
<p class=MsoNormal align=center style='text-align:center'>
<span lang=EN-US>
<!--[if gte vml 1]>
<v:shape id="_x0000_i1040" onclick="fangda(this)" type="#_x0000_t75" style='width:290.25pt;height:86.25pt'>
<v:imagedata src=/uploadfile/wangluo_anquan/uploadfile/200903/20090330070940446.png" o:title="W143"/>
</v:shape>
<![endif]-->
<![if !vml]>
<img onclick="fangda_x(this)" width=387 height=115 src=/uploadfile/wangluo_anquan/uploadfile/200903/20090330070942146.jpg" v:shapes="_x0000_i1040">
<![endif]>
</span>
</p>

注意:是加在标签v:shape里,而不是v:imagedata

使用wode另存为web页的功能 XML 相关是www1098t.com的会员在asp编程最新发表的,同时也欢迎你就使用wode另存为web页的功能 XML 相关提问.欢迎来到我们的服务器编程网站查询功能的文章.
关键词:功能

[错误报告] [推荐] [收藏] [打印] [关闭] [返回顶部]

  • 验证码:

最新图片文章

最新文章