As I say, I'm still not real clear on what you are going for, here's something I'm playing with:
Code:
<!DOCTYPE html>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
object {
display: none;
overflow: hidden;
}
#header {
overflow: hidden;
}
h1 {
float: left;
width: 8em;
}
input {
float: left;
margin-left: 1em;
position: relative;
top: 2em;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"></script>
<script type="text/javascript">
jQuery(function($){
var win = $(window), b = $('body'), t = $('#target'), m = parseInt(b.css('marginTop')) + parseInt(b.css('marginBottom')), count = 0, h, w;
function sizeIt(){
$('#objectStyle_' + (count - 1)).remove();
h = win.height() - $('#header').outerHeight(true) - m;
w = Math.round(h * (6 / 8.25));
$('head').append('<style id="objectStyle_' + (++count) + '" type="text/css">object {display: block; height: ' + h + 'px; width: ' + w + 'px; }<\/style>');
}
sizeIt();
win.resize(sizeIt);
$('input.loader').click(function(){
t.load(this.value + '.htm', function(data){t.html(data);});
});
});
</script>
</head>
<body>
<div id="header">
<h1>Header</h1>
<input class="loader" type="button" value="1234">
</div>
<div id="target">
</div>
</body>
</html>
1234.htm:
Code:
<object data="1234.pdf" type="application/pdf">
alt : <a href="1234.pdf">1234.pdf</a>
</object>
Notes: This is a little non-standard for jQuery because of IE quirks. Ordinarily using the data of the load() function in the manner I have here is redundant. But it produces valid HTML 5 markup. Otherwise IE would frequently refuse to show the imported PDF.
Removing the next to most recently added style object during window resizing seemed only to be required in IE as well. Seems IE can only handle so many style sections in the head before it starts ignoring them. And it was unable to consistently keep the object tag visible without keeping at least one around during the process of inserting the next.
The markup and styles are fairly standard, but a bit constrained. Care should be taken in adding to this layout. An understanding of floats within an overflow: hidden container helps. For example, the header division should not be given dimensions. If so, some of its content may disappear.
Any external .htm file may be loaded by an input with the class 'loader'. It will be the value of the input + the .htm extension. So it can be used with selects or text inputs (caution here, the user can enter anything) as well as button inputs (as in this example) or with a radio button group. With a little tweaking to check for the checked state checkboxes could be used as well. Checkboxes and text inputs don't make a lot of sense to me though.
Bookmarks