- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<meta name="generator" content="PSPad editor, www.pspad.com">
<title></title>
<title></title>
<style type="text/css">
button {
font-size: 1.2em;
font-family: Times New Roman, sans-serif, Arial;
margin-right: 30px;
}
</style>
</head>
<body bgcolor="#FFFF99">
<button onmouseover="setTruck()">move truck</button>
<button onmouseover="setBall()">move ball</button>
<script>
addEventListener("mousedown", function(event){
sendDown();
}, true);
addEventListener("mouseup", function(event){
sendUp();
}, true);
function setTruck() {
top.tbfunction_pgTBObjSet("objectSelected","text","truck");
}
function setBall() {
top.tbfunction_pgTBObjSet("objectSelected","text","ball");
}
function sendDown()
{
top.tbfunction_pgTBObjSet("startTimer","trigger");
}
function sendUp()
{
top.tbfunction_pgTBObjSet("stopTimer","trigger");
}
</script>
</body>
</html>
You can see the result here http://www.mediacours.com/tb_examples/buttondown-up Apologies for the naf example

Could I have done this without resorting to pgGotoURL?
And if not how could I make the buttons look more like Toolbook buttons?