数码资讯
使用jtopo添加鼠标事件的元素绘制在HTML5的调研
画在画布上的东西不能对应的鼠标事件,但它是非常简单的使用jtopo添加事件。这里有一个你可以参考的例子。 使用HTML5时,画在画布上的东西无法对应鼠标事件,但jtopo添加事件很简单,而且效果如下: 代码示例: 复制代码代码如下所示: var =新jtopo节点。节点(你好); (409, 269
选购提示
关注价格、性能、续航、售后和真实使用场景,理性比较后再下单。
画在画布上的东西不能对应的鼠标事件,但它是非常简单的使用jtopo添加事件。这里有一个你可以参考的例子。
使用HTML5时,画在画布上的东西无法对应鼠标事件,但jtopo添加事件很简单,而且效果如下:
代码示例:
复制代码代码如下所示:
var =新jtopo节点。节点(你好);
(409, 269)node.setlocation;
node.mousedown(功能(事件){)
如果(event.button = = 2){
node.text =右;
} else if(event.button = = 1){
node.text =按中键;
} else if(event.button = = 0){
node.text =按左键;
}
});
Node.mouseup(功能(事件){)
如果(event.button = = 2){
node.text =松开右键;
} else if(event.button = = 1){
node.text =松开中间键;
} else if(event.button = = 0){
node.text =松开左键;
}
});
Node.click(功能(事件){)
console.log(点击);
});
Node.dbclick(功能(事件){)
console.log(双重打击);
});
Node.mousedrag(功能(事件){)
console.log(拖放);
});
Node.mouseover(功能(事件){)
console.log(鼠标悬停);
});
Node.mousemove(功能(事件){)
console.log(鼠标移动);
});
Node.mouseout(功能(事件){)
console.log(怪);
});
使用HTML5时,画在画布上的东西无法对应鼠标事件,但jtopo添加事件很简单,而且效果如下:
代码示例:
复制代码代码如下所示:
var =新jtopo节点。节点(你好);
(409, 269)node.setlocation;
node.mousedown(功能(事件){)
如果(event.button = = 2){
node.text =右;
} else if(event.button = = 1){
node.text =按中键;
} else if(event.button = = 0){
node.text =按左键;
}
});
Node.mouseup(功能(事件){)
如果(event.button = = 2){
node.text =松开右键;
} else if(event.button = = 1){
node.text =松开中间键;
} else if(event.button = = 0){
node.text =松开左键;
}
});
Node.click(功能(事件){)
console.log(点击);
});
Node.dbclick(功能(事件){)
console.log(双重打击);
});
Node.mousedrag(功能(事件){)
console.log(拖放);
});
Node.mouseover(功能(事件){)
console.log(鼠标悬停);
});
Node.mousemove(功能(事件){)
console.log(鼠标移动);
});
Node.mouseout(功能(事件){)
console.log(怪);
});
声明:本文内容用于数码产品信息整理与选购参考,具体价格、库存、售后政策以官方渠道和电商页面实时信息为准。