Solved

button iframe switch

Posted on 2011-02-28
2
190 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS Style on Chrome 1 57
ASP sending two datas 2 28
Merge two Google Chrome Bookmark files or convert Excel list into an HTML file 3 73
object method as an event handler 8 75
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

734 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