Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding 2 functions to 1 on click

Status
Not open for further replies.

ramblenman

Technical User
Joined
Sep 27, 2003
Messages
14
Location
CA
I need help with this because I can not get it to work.
I want to change this so that instead of a user clicking on the "click here to continue", when a person clicks on the picture, the new frame automaticly loads. Basicaly I just want to combined the 2 functions. When a user clicks on the picture, the new frame will be loaded(the target frame is different for each picture). Can someone help me with this?

<html>
<head>
<title>Chiller</title>
<script type="text/javascript">
<!--
function Bottle(bottle,img) {
parent.bottleAmount=bottle*10;
parent.RightFrame.ImageToChange2.src=img
}
function changeframe(){
parent.LeftFrame.document.location = "leftcap.html";
}

// -->
</script>
</head>
<body>
<form action="">
<br>
<img src="dbd500ml.jpg" onclick="Bottle(0.20,this.src)" style="position:relative;width:100px;height:300px;" alt="A picture" />

<img src="cr500ml.jpg" onclick="Bottle(0.30,this.src)" style="position:relative;width:100px;height:300px;" alt="A picture" />

<br>

<a href="#" onclick = "changeframe();">Click here to continue</a>

</form>


</form>
</body>
</html>
 
I think this is what you're looking for:

[tt]<img src="dbd500ml.jpg" onclick="Bottle(0.20,this.src); changeframe();" style="position:relative;width:100px;height:300px;" alt="A picture" />[/tt]

*cLFlaVA
----------------------------
A pirate walks into a bar with a huge ship's steering wheel down his pants.
The bartender asks, "Are you aware that you have a steering wheel down your pants?"
The pirate replies, "Arrrrr! It's driving me nuts!
 
Thanks muchly, that works perfect.

Thanks again .
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top