iFrames and Click Events
Idealy what I would like to do is have three buttons (linked in, twitter, facebook) and i would like for the specific files (linkedin.html, twitter.html, facebook.html) appear in the same iFrame. I don't know how to use a click event with multiple documents appearing in the same iFrame just the one:
<iframe src ="Twitter.html" width="100%" height="100">
<p>Your browser does not support iframes.</p>
</iframe>
I think it has to be something like :
<input style="margin-bottom:5px;font-family:verdana;" name ="TwitterButton" type ="submit" value=Twitter" >>" onClick="displayiFrameTwitter()" >
<input style="margin-bottom:5px;font-family:verdana;" name ="FacebookButton" type ="submit" value=Facebook" >>" onClick="displayiFrameFacebook()" >
<input style="margin-bottom:5px;font-family:verdana;" name ="LinkedInButton" type ="submit" value=LinkedIn" >>" onClick="displayiFrameLinkedin()" >
<script type="text/javascript">
function displayiFrameTwitter()
{
document.getElementById("twitterframe").src="twitter.html"
}
function displayiFrameFacebook()
{
document.getElementById("facebookframe").src="facebook.html"
}
function displayiFrameLinkedin()
{
document.getElementById("linkedinframe").src="linkedin.html"
}
</script>
Am I on the right path? Where do i go next?
Thank you all for the help.
|