Solved

button iframe switch

Posted on 2011-02-28
2
186 Views
Last Modified: 2012-05-11
I have the following code that switches iframes once it is selected from the dropdown menu.  But I now want to get rid of the dropdown menu and have them all as on page buttons instead.  How do I modify my existing code to support them as buttons instead of dropdown selected.

<form name="form1">
<select name="list1" id="list1" onChange="if(this.selectedIndex>0) for(i=0;i<4;i++) if((this.selectedIndex-1)==i) document.getElementsByTagName('iframe')[i].style.display='block'; else document.getElementsByTagName('iframe')[i].style.display='none';" style="font-family:Verdana, Geneva, sans-serif; color:#666; font-size:11px;">
    <option selected value="">Please Select...</option>
    <option>Profile Information</option>
    <option>Overall Leaderboards</option>
    <option>Portfolio Leaderboards</option>
    <option>Friends Invitation</option>
</select>
</form>
</td>
</tr>
</table>
<table width="100%" align="center" id="map_td2">
  <tr>
    <td width="100%" rowspan="31" align="center" valign="top">
    

<iframe src="box/UserData.html" width="720" height="480" frameborder="0" scrolling="no"></iframe>

<iframe width="720" height="480" frameborder="0" scrolling="no" style="display:none" src="../datagrid/box/global_ranking.html"></iframe>

<iframe width="720" height="480" frameborder="0" scrolling="no" style="display:none" src="../datagrid/box/portfolio_ranking.html"></iframe>

<iframe width="720" height="480" frameborder="0" scrolling="no" style="display:none" src="../datagrid/box/invite.html"></iframe>

Open in new window

0
Comment
Question by:MsKrissy
2 Comments
 
LVL 14

Accepted Solution

by:
Designbyonyx earned 500 total points
ID: 35002566
I think something like this should work.  You will have to use CSS to make the links look like buttons:

<ul id="links">
  <li><a href="/some/path/to/page1.html" target="myIframe">Page 1</a></li>
  <li><a href="/some/path/to/page2.html" target="myIframe">Page 2</a></li>
  <li><a href="/some/path/to/page3.html" target="myIframe">Page 3</a></li>
  <li><a href="/some/path/to/page4.html" target="myIframe">Page 4</a></li>
</ul>

<iframe src="box/UserData.html" width="720" height="480" frameborder="0" scrolling="no" name="myIframe></iframe>

Open in new window

0
 

Author Closing Comment

by:MsKrissy
ID: 35009211
thanks you, this worked greatly.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now