Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-22-2012, 03:49 PM   PM User | #1
andycode
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
andycode is an unknown quantity at this point
roulette javascript

Hello! this is my first post.

I am working on a website where I need a roulette. I chose this one.

http://www.switchonthecode.com/tutor...#comment-11861

My problem is that I can not get the text to become a link. (clickable)(a href)

I am new to JavaScript and HTML 5 <canvas>

But I can not get it to work :/

Some good suggestions? I would Greatly appreciate.
andycode is offline   Reply With Quote
Old 09-23-2012, 12:40 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,579
Thanks: 62
Thanked 4,064 Times in 4,033 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
What test? And where is your code? We can't see what you did wrong if you don't show us your code.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Old 09-23-2012, 09:51 AM   PM User | #3
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,105
Thanks: 197
Thanked 2,422 Times in 2,400 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
Quote:
Originally Posted by Old Pedant View Post
What test? And where is your code? We can't see what you did wrong if you don't show us your code.
Text, not test. The code is presumably that given in the link.

var restaraunts = ["Wendy's", "McDonalds", "Chick-fil-a", "Five Guys",
"Gold Star", "La Mexicana", "Chipotle", "Tazza Mia",
"Panera", "Just Crepes", "Arby's", "Indian"];

He wants to make each restaurant a clickable link.
__________________

All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.

Last edited by Philip M; 09-23-2012 at 09:54 AM..
Philip M is offline   Reply With Quote
Old 09-23-2012, 04:11 PM   PM User | #4
xelawho
Senior Coder

 
xelawho's Avatar
 
Join Date: Nov 2010
Posts: 2,461
Thanks: 52
Thanked 457 Times in 455 Posts
xelawho will become famous soon enoughxelawho will become famous soon enough
the problem is that text on a canvas is not text but rather a drawn shape, and therefore it's not as simple as turning "normal" html text into a link.

what you basically have to do is save the locations of your text on the canvas and then turn them into clickable regions.

you can google the subject - there are plenty of tutorials out there, but I would say that if you have only a basic understanding of html and js, this is a very ambitious undertaking at this point.
xelawho is offline   Reply With Quote
Old 10-03-2012, 10:52 AM   PM User | #5
andycode
New to the CF scene

 
Join Date: Sep 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
andycode is an unknown quantity at this point
Thumbs up

ok thx!!
andycode is offline   Reply With Quote
Reply

Bookmarks

Tags
a href, canvas, clickable, html5, javascript

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:59 PM.


Advertisement
Log in to turn off these ads.