开发者

hyperlink text on a canvas in html5 [duplicate]

开发者 https://www.devze.com 2023-03-27 07:38 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: Create links in HTML canvas
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Create links in HTML canvas

I have filled text in a html5 canvas using

window.onload = function() {
            var theCanvas = document.getElementById('Canvas1');
            if (theCanvas && theCanvas.getContext) {
                var ctx = theCanvas.getContext("2d");
 开发者_StackOverflow社区               if (ctx) {
                                                ctx.fillStyle = "yellow";

                    ctx.fillText("INDEX",325,105);
                    }}}

Now i want to hyperlink whatever text i have entered how do i do that? Thank you


Short of creating a system that parses the text for hyperlinks, measures its position and checks for clicks on it, you can't.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号