These forums are currently read-only due to receiving more spam than actual discussion. Sorry.

It is currently Sat Dec 02, 2017 4:23 pm Advanced search

canvas and usemap

Here you can discuss things related to HTML and the Web in general that do not fit in to other categories.

canvas and usemap

Postby pedz » Tue Mar 16, 2010 1:02 am

I'm going to start this as a question. I did a search and found only one thread with these two keywords.

The question is, what is the intended method of using canvas that has "hot spots" on it which would trigger a javascript hover event or something similar?

For example, I have a canvas which is a rectangle and inside I draw various elements that represent a network with nodes and lines between the nodes. I want to mouse over one of the nodes and have a pop up or perhaps a title or any number of things that are currently associated with today's web page interfaces.

Is this currently a "roll your own" type of situation or have do the designers have some ideas on how this should work?

It seems like the simple way would be to use a usemap attribute on the canvas. Another option is to wrap the canvas inside an object tag but then there is the question of making the two take up exactly the same area. Before diving too deep into this, I thought I'd ask. It seems like this will be fairly common when canvas catches on.

Thank you,
Perry
pedz
<h6>
 
Posts: 6
Joined: Tue Mar 16, 2010 12:49 am

Postby spmorr02 » Tue Mar 16, 2010 11:29 am

This sounds like a use case where you would be much better off using SVG.
spmorr02
<h5>
 
Posts: 19
Joined: Thu Jan 21, 2010 5:37 pm
Location: Louisville, Kentucky

Postby pedz » Tue Mar 16, 2010 12:44 pm

Yes. I discovered SVG after I posted the email. Now I'm trying to come up to speed on it.

Thank you for the reply.
Perry
pedz
<h6>
 
Posts: 6
Joined: Tue Mar 16, 2010 12:49 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests