Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use jTopo to add mouse events to elements drawn in Html5 Canva

Shulou Source: shulou.com Published: 2022-06-03 08:12:26 09月11日 Update

This article introduces the knowledge of "how to use jTopo to add mouse events to the elements drawn in Html5 Canva". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The code is as follows:

Var node = new JTopo.Node ("Hello")

Node.setLocation (409,269)

Node.mousedown (function (event) {

If (event.button = = 2) {

Node.text = 'right button'

} else if (event.button = = 1) {

Node.text = 'press the middle button'

} else if (event.button = = 0) {

Node.text = 'press the left button'

}

});

Node.mouseup (function (event) {

If (event.button = = 2) {

Node.text = 'release right button'

} else if (event.button = = 1) {

Node.text = 'release the middle button'

} else if (event.button = = 0) {

Node.text = 'release the left button'

}

});

Node.click (function (event) {

Console.log (Click)

});

Node.dbclick (function (event) {

Console.log ("double click")

});

Node.mousedrag (function (event) {

Console.log ("drag and drop")

});

Node.mouseover (function (event) {

Console.log ("mouseover")

});

Node.mousemove (function (event) {

Console.log ("mousemove")

});

Node.mouseout (function (event) {

Console.log ("mouseout")

});

That's all for "how to use jTopo to add mouse events to elements drawn in Html5 Canva". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Events elements mouse content more knowledge practicality learning next code dilemma reality situation articles cases editing websites industries processes high quality Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Xiaomi Redmi Shulou Technology MySQL