views:

482

answers:

2

I have a iframe that i want to open pdf's into from a list on the side bar.

I have everything working but the pdf shows up in a little 500 by 200 box on the and wont "resize" to so the user can read the entire page.

the live site is located here http://www.markonsolutions.com/opportunities.php

and the code behind it is

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
<!--
Design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
-->
<html xmlns="http://www.w3.org/1999/xhtml"&gt;
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>MARKON, Inc. - Professional Services, Personal Solutions</title>
<meta name="keywords" content="" />
<meta name="description" content="" />
<link href="careers.css" rel="stylesheet" type="text/css" />
</head>
<body>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-8011431-1");
pageTracker._trackPageview();
} catch(err) {}</script>
<div id="header"></div>
<div id="menu">
<ul>
<li><a href="index.html" accesskey="1">Home</a></li>
<li><a href="aboutus.html" accesskey="2">About Us</a></li>
<li><a href="capabilities.html" accesskey="3">Capabilities</a></li>
<li><a href="contracts.html" accesskey="4">Contracts</a></li>
<li><a href="careers.html" accesskey="5">Careers</a></li>
<li><a href="contactus.html" accesskey="6">Contact Us</a></li>
</ul>
</div>
<div id="content">
<div id="colOne">
<h2>Opportunities</h2>

<IFRAME SRC="newpage.html" width="100%" height="100%" id="iframe1" marginheight="0" frameborder="0" "></iframe>


</div>
<div id="colTwo">
<h2>Careers</h2>
<ul>
<li><a href="opportunities.html">Opportunities</a></li>
<li><a href="benefits.html">Benefits</a></li>
</ul>
<h2>Open Positions</h2>
<?php
$files = glob("./jobops/*.pdf");

sort($files);

//print("<br>"+count($files)+"<br>");

print("<ul>");
foreach ($files as &$file)
{
    $Jobname =substr($file,0,strlen($file)-4);
    $Jobname = str_replace("./jobops/","",$Jobname);
    print("<li><a href=\"$file\" target=\"iframe1\">$Jobname</a></li>");
}
print("</ul>");
?>
</div>
<div style="clear: both;">&nbsp;</div>
</div>
<div id="footer">
<p>Copyright &copy; 2009 <a href="http://www.markonsolutions.com"&gt;&lt;strong&gt;MARKON, Inc.</strong></a></p>
</div>
</body>
</html>
+1  A: 

the code that shows up in the rendered page is setting the height at 200px...

<IFRAME SRC="newpage.html" width="100%" height="200px"...

and the rendered code for newpage.html includes a close div tag but not an open tag for the div.

What are you using to populate the text from the pdf to newpage?

Badfish
I don't understand the question.
Crash893
either the process you are using to populate the newpage is imprpoerly including an closing div or the closing div is getting in there somewhere... basically, if you include an opening div with the style elements to set the height to 100%, then you should be fine.
Badfish
A: 

I was uploading the wrong version!

theres nothing like troubleshooting the wrong file for a few hours

Ive made a little progress with this javascript code but it only adjusts for height not width which I'm not sure how to fix but i know that its linked to the inital size of the iframe.

any ideas?

function calcHeight()
    {
     try
     { 
      var oBody = ifrm.document.body;
      var oFrame = document.all("ifrm");

      oFrame.style.height = oBody.scrollHeight + (oBody.offsetHeight - oBody.clientHeight);
      oFrame.style.width = oBody.scrollWidth + (oBody.offsetWidth - oBody.clientWidth);
     }
     //An error is raised if the IFrame domain != its container's domain
     catch(e)
     {
      window.status = 'Error: ' + e.number + '; ' + e.description;
     }

    }
Crash893