JitenNikhil
asked on
Collapsing and expanding iframes on click of a link!
Hi!
I am using a 'Master.jsp' that uses "iframes".
I also have a code, that expands or collapses the iframes when the + button is clicked!
The code run as:
<tr>
<td width="100%" id="block1" class="sectionOpen" onClick="ShowHide('block1' ,'employee InfoTab',' <%=request .getContex tPath()%>/ jsp/resume /ShowEmplo yee.do','e mployeeInf oFrame')" >employee info</td>
</tr>
<tr style="display: '';" id="employeeInfoTab"><td width="100%">
<iframe src="<%=request.getContext Path()%>/j sp/resume/ ShowEmploy ee.do" name="employeeInfoFrame" width="100%" height="520">
</iframe>
</td>
</tr>
The problem is that I have a EXPANDALL and COLLAPSEALL link in the header file!
If I click on this I want all the pages(iframes) to collapse or expand! How do I achieve this!
Pls guide!
JitenNikhil
I am using a 'Master.jsp' that uses "iframes".
I also have a code, that expands or collapses the iframes when the + button is clicked!
The code run as:
<tr>
<td width="100%" id="block1" class="sectionOpen" onClick="ShowHide('block1'
</tr>
<tr style="display: '';" id="employeeInfoTab"><td width="100%">
<iframe src="<%=request.getContext
</iframe>
</td>
</tr>
The problem is that I have a EXPANDALL and COLLAPSEALL link in the header file!
If I click on this I want all the pages(iframes) to collapse or expand! How do I achieve this!
Pls guide!
JitenNikhil
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
My Master.jsp looks like:
<body>
<table id="info" width="100%">
<tr id="header">
<td width="100%">
<iframe height="100" src="header.jsp" width="100%"></iframe>
</td>
</tr>
<%if(request.isUserInRole( "resume_ad min")){%>
<tr id="control">
<td width="100%" id="block1" class="sectionOpen" onClick="ShowHide('block1' ,'searchIn foTab')" >Search</td>
</tr>
<tr style="display: '';" id="searchInfoTab">
<td width="100%">
<iframe src="<%=request.getContext Path()%>/j sp/resume/ ShowSearch Page.do" width="100%" height="520">
</iframe>
</td>
</tr>
and my header.jsp looks like:
<script>
function CollapseAll() {
var t = document.getElementById('i nfo');
for (var i = 0; i < t.rows.length; i++) {
if (t.rows[i].id != "control") {
t.rows[i].style.display = 'none';
t.rows[i].style.visibility = 'hidden';
}
}
</script>
<td width="50%" class="logo"><div align="center"><a href="#">EXPAND ALL</a> | <a href="CollapseAll()">COLLA PSE ALL</a> </div>
<body>
<table id="info" width="100%">
<tr id="header">
<td width="100%">
<iframe height="100" src="header.jsp" width="100%"></iframe>
</td>
</tr>
<%if(request.isUserInRole(
<tr id="control">
<td width="100%" id="block1" class="sectionOpen" onClick="ShowHide('block1'
</tr>
<tr style="display: '';" id="searchInfoTab">
<td width="100%">
<iframe src="<%=request.getContext
</iframe>
</td>
</tr>
and my header.jsp looks like:
<script>
function CollapseAll() {
var t = document.getElementById('i
for (var i = 0; i < t.rows.length; i++) {
if (t.rows[i].id != "control") {
t.rows[i].style.display = 'none';
t.rows[i].style.visibility
}
}
</script>
<td width="50%" class="logo"><div align="center"><a href="#">EXPAND ALL</a> | <a href="CollapseAll()">COLLA
Missing a '}' at the end of CollapseAll() => script error (?!)
ASKER
thanks Daohailam!
ASKER
I am having this code inside the Header.jsp!
<a href="javascript:ShowAll()
So even though I make the changes it does not work!