Loob
10-01-2011, 07:11 PM
Hi guys,
For a web project we want to have a talent calculator, sth. like this one: http://www.wowhead.com/talent#oh
- with a left click you can add a point, with a right click you can remove this one
- you should see somewhere how many points you still have
I havenīt so much experience with javascript so i want to ask, if you have a script (similar to this) which i can customize and start with.
I found this thread: http://www.codingforums.com/showthread.php?t=223671 and this code
<html>
<head>
<script type="text/javascript">
function m_click( what )
{
if ( what.style.backgroundColor == "lime" )
{
what.style.backgroundColor = "pink";
what.title = "0%";
} else {
what.style.backgroundColor = "lime";
what.title = "33%";
}
}
</script>
</head>
<body>
<form>
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
</form>
</body>
</html>
Itīs a way too simple but itīs a start- maybe. :(
Thank you for the help!
For a web project we want to have a talent calculator, sth. like this one: http://www.wowhead.com/talent#oh
- with a left click you can add a point, with a right click you can remove this one
- you should see somewhere how many points you still have
I havenīt so much experience with javascript so i want to ask, if you have a script (similar to this) which i can customize and start with.
I found this thread: http://www.codingforums.com/showthread.php?t=223671 and this code
<html>
<head>
<script type="text/javascript">
function m_click( what )
{
if ( what.style.backgroundColor == "lime" )
{
what.style.backgroundColor = "pink";
what.title = "0%";
} else {
what.style.backgroundColor = "lime";
what.title = "33%";
}
}
</script>
</head>
<body>
<form>
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
<input type="button" style="background-color: pink;" title="0%" onclick="m_click(this);" />
</form>
</body>
</html>
Itīs a way too simple but itīs a start- maybe. :(
Thank you for the help!