IE与Firefox的HTC实现-网站制作-编程文档-人才家园--中国人才库
您所在的位置:中国人才库--人才家园--编程文档--网站制作
IE与Firefox的HTC实现
来源: 编辑:duliying 更新日期:2008-5-30 14:56:02 浏览:151 次
test.htm <style>
span {-moz-binding: url(test.xml#custom);behavior:url(test.htc);cursor:pointer;background:#ddd;}
</style>
<span> test </span> //IE
test.htc <attach event="onmouseup" onevent="up()"/>
<attach event="onmousedown" onevent="down()"/>
<script language="javascript">
var currX = 0;
function up(){
  alert(currX);
}
function down(){
  currX += 1;
}
</script> //Firefox
test.xml <?xml version="1.0"?>
<bindings xmlns="http://www.mozilla.org/xbl" xmlns:html="http://www.w3.org/1999/xhtml">
  <binding id="custom" styleexplicitcontent="true">
   <implementation>
    <property name="currX">0</property>
   </implementation>
   <handlers>
    <handler event="mousedown">
     this.currX = event.clientX+this.currX;
    </handler>
    <handler event="mouseup">
     alert(parseInt(this.currX));
    </handler>
   </handlers>
  </bind
 第1页/总2页  第一页 上一页 下一页 最后一页     【发表评论】
昵   称:  (不填写则显示为匿名)
标   题:
内   容:
 
免责声明:网友对此资源信息的评论仅代表个人观点,中国人才库有权删除违乱评论信息!
石家庄广通印刷学校