动网论坛,站长建站首选,国内使用量最多的论坛软件 动网论坛官方技术讨论区 站长工具 申请属于您自己的免费论坛
首页 | 新闻资讯 | 网站运营 | 网络编程 | 数据库 | 服务器 | 网页设计 | 图像媒体 | 网络应用 | 搜索优化 | 资源下载 | 动网主机 | DVBOX
    本站内  互联网 ASP论坛  ASP.Net论坛  PHP论坛
  
   Xml → 阅读文章

 使用wode另存为web页的功能

作者来源: 
阅读 1437 人次 , 2006-3-29 3:14:00 

使用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="./9070500.files/image036.png" o:title="W143"/>
</v:shape>
<![endif]-->
<![if !vml]>
<img onclick="fangda_x(this)" width=387 height=115 src="./9070500.files/image037.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="./9070500.files/image036.png" o:title="W143"/>
</v:shape>
<![endif]-->
<![if !vml]>
<img onclick="fangda_x(this)" width=387 height=115 src="./9070500.files/image037.jpg" v:shapes="_x0000_i1040">
<![endif]>
</span>
</p>

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

 
 收藏本文  打印本文  论坛讨论  关闭窗口
· 上一篇:利用ASP + XML 架设在线考试系统
· 下一篇:使用XML和SQL Server 2000管理存储过程调用
· 利用XSLT把ADO记录集转换成XML
· XML与其相关技术
· XML 中的常见问题 (一)
· J2ME与XML的集成
· XSLT轻松入门第二章:XSLT的实例(2)


关于本站 | 联系我们 | 业务合作 | 客户案例 | 诚聘英才 | 广告合作 | 收藏本站
海口动网先锋网络科技有限公司版权所有
Copyright © 2000 - 2006 Cndw.Com
中华人民共和国电信与信息服务业务经营许可证编号 琼 ICP 020077