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

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

how do I create external links within a canvas?

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

how do I create external links within a canvas?

Postby missionman » Tue Oct 19, 2010 10:19 pm

I have figured out how to draw multiple canvases on top of each other, and will be using .png images to represent links. For example, I have created a 3D-style book in .png format that says "journal" on it and has my logo printed on the book as well. When someone clicks on the book, I want it to open journal.htm. I cannot figure out how to do this, as I am using functions to draw the image in an absolute position so it appears to be on the ground (which is a .jpg background file).

In short, how do I create external links within a canvas when someone clicks on an image within that canvas? For now, I just want to bring up a basic pop-up window that will display data, including links. Later, I plan on adding some animations.
missionman
<h6>
 
Posts: 2
Joined: Tue Oct 19, 2010 10:12 pm

Postby Alan » Tue Nov 02, 2010 4:22 pm

Depends on what you are trying to achieve.

If you want the portion of the canvas to behave like a regular link, look into JavaScript links (usually implemented with a click handler and the location object). You just need to handle clicks within the region accordingly.

If you want a "pop-in" effect, i.e. load external data into the existing web page, you should either use AJAX to retrieve an HTML fragment, or you could create an iframe.

This question on StackOverflow might have some relevant answers for you.
Alan
<h5>
 
Posts: 18
Joined: Sun Oct 31, 2010 2:16 pm
Location: Cologne, Germany

Postby missionman » Fri Nov 05, 2010 9:02 am

Thanks, ultimately I just used transparent images, some java for the pop up links, and a tiny bit of css for the background file to work correctly. If you want to see what I've done, you can go to MissionMan.net and check it out.
missionman
<h6>
 
Posts: 2
Joined: Tue Oct 19, 2010 10:12 pm


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 0 guests