Never mind on that. Figured it out. Another question.
I am having difficulty with getting a div to expand to fit the content of itself. The problem is that the code uses jQuery to animate its resizing. The code is in the code block below. Anyone any ideas about what I'm doing wrong?
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ACagliano's Portfolio</title>
<style type="text/css">
#main_centerbox {
position:absolute;
width:250px;
height:100px;
top:200px;
left:370px;
border:5px solid black;
background-color:white;
padding:50px;
z-index:3;
text-align:center;
}
#main_codingsamples {
position:absolute;
background-color:red;
top:0px;
left:0px;
width:50%;
height:50%;
border:2px solid black;
z-index:2;
}
#main_graphicdesignsamples {
position:absolute;
background-color:blue;
top:0px;
left:50%;
width:50%;
height:50%;
border:2px solid black;
z-index:2;
}
#main_webdesignsamples {
position:absolute;
background-color:green;
top:50%;
left:0px;
width:50%;
height:50%;
border:2px solid black;
z-index:2;
}
#main_summary {
position:absolute;
background-color:yellow;
top:50%;
left:50%;
width:50%;
height:50%;
border:2px solid black;
z-index:2;
}
pre {
position:relative;
border:1px solid black;
background-color:#c0c0c0;
top:200px;
left:50px;
width:800px;
height:300px;
text-align:left;
word-wrap: break-word;
overflow:auto;
}
</style>
<script src="jquery.js"></script>
<script>
$(document).ready(function(){
$("#code_samples").click(function() {
$("#main_centerbox").animate({
left:'0px',
top:'0px',
height:'auto',
width:'90%',
overflow:'auto'
});
$(".maintext").hide();
$("#code_samplesdisplay").fadeIn("slow");
});
});
$(document).ready(function() {
$(".goback").click(function() {
$("#main_centerbox").animate({
top:'200px',
left:'370px',
width:'250px',
height:'100px'
});
$(".notmain").hide();
$(".maintext").show();
});
});
$(document).ready(function(){
$("#graphics_samples").click(function() {
$("#main_centerbox").animate({
left:'0px',
top:'0px',
height:'100%',
width:'90%',
overflow:'auto'
});
$(".maintext").hide();
$("#graphics_samplesdisplay").fadeIn("slow");
});
});
$(document).ready(function(){
$("#web_samples").click(function() {
$("#main_centerbox").animate({
left:'0px',
top:'0px',
height:'100%',
width:'100%',
overflow:'auto'
});
$(".maintext").hide();
$("#web_samplesdisplay").fadeIn("slow");
});
});
$(document).ready(function(){
$("#summary_samples").click(function() {
$("#main_centerbox").animate({
left:'0px',
top:'0px',
height:'100%',
width:'100%',
overflow:'auto'
});
$(".maintext").hide();
$("#summary_display").fadeIn("slow");
});
});
</script>
</head>
<body>
<div id="main_centerbox">
<span class="maintext" style="font-weight:bold; font-size:140%;">Web Design Portfolio</span>
<br />
<span class="maintext" style="font-size:110%;">of Anthony Cagliano</span>
<div id="code_samplesdisplay" class="notmain" style="position:absolute; top:0px; left:0px; margin:50px; margin-top:10px; padding:50px; text-align:left; display:none;">
<img class="goback" src="backarrow.gif" style="position:relative; top:0px; left:0px; width:60px; height:60px; cursor:hand; cursor:pointer;" />
<h1 style="position:relative; left:10px;">Coding Samples</h1>
<br />
<h3 style="position:relative;">Author Page @ ClrHome</h3>
<pre>code to put</pre>
<span>The source code of the page at http://ac.clrhome.org</span>
<br />
<h3>Project Zelda</h3>
<pre>code to put</pre>
<span>The source of my currently incomplete Legend of Zelda game.</span>
</div>
<div id="graphics_samplesdisplay" class="notmain" style="position:absolute; top:0px; left:0px; margin:50px; margin-top:10px; padding:50px; display:none;">
<img class="goback" src="backarrow.gif" style="position:absolute; top:0px; left:0px; width:60px; height:60px; cursor:hand; cursor:pointer;" />
<h1 style="position:relative; left:10px;">Graphics Design Samples</h1>
</div>
<div id="web_samplesdisplay" class="notmain" style="position:absolute; top:0px; left:0px; margin:50px; margin-top:10px; padding:50px; display:none;">
<img class="goback" src="backarrow.gif" style="position:absolute; top:0px; left:0px; width:60px; height:60px; cursor:hand; cursor:pointer;" />
<h1 style="position:relative; left:10px;">Web Design Samples</h1>
</div>
<div id="summary_display" class="notmain" style="position:absolute; top:0px; left:0px; margin:50px; margin-top:10px; padding:50px; display:none;">
<img class="goback" src="backarrow.gif" style="position:absolute; top:0px; left:0px; width:60px; height:60px; cursor:hand; cursor:pointer;" />
<h1 style="position:relative; left:10px;">Summary</h1>
</div>
</div>
<div id="main_codingsamples">
<img id="code_samples" src="folder.png" alt="folder" style="position:absolute; top:0px; left:30px; width:300px; height:280px; cursor:hand; cursor:pointer; z-index:0;" />
<span style="position:absolute; display:block; top:140px; left:100px; font-size:120%; font-weight:bold; color:white; cursor:hand; cursor:pointer; z-index:1;">Coding Samples</span>
</div>
<div id="main_graphicdesignsamples">
<img id="graphics_samples" src="folder.png" alt="folder" style="position:absolute; top:0px; left:200px; width:300px; height:280px; cursor:hand; cursor:pointer; z-index:0;" />
<span style="position:absolute; top:140px; left:250px; font-size:120%; font-weight:bold; color:white; cursor:hand; cursor:pointer; z-index:1;">Graphics Design Samples</span>
</div>
<div id="main_webdesignsamples">
<img id="web_samples" src="folder.png" alt="folder" style="position:absolute; top:0px; left:30px; width:300px; height:280px; cursor:hand; cursor:pointer; z-index:0;" />
<span style="position:absolute; top:150px; left:100px; font-size:120%; font-weight:bold; color:white; cursor:hand; cursor:pointer; z-index:1;">Web Design Samples</span>
</div>
<div id="main_summary">
<img id="summary_samples" src="folder.png" alt="folder" style="position:absolute; top:0px; left:200px; width:300px; height:280px; cursor:hand; cursor:pointer; z-index:0;" />
<span style="position:absolute; top:150px; left:300px; font-size:120%; font-weight:bold; color:white; cursor:hand; cursor:pointer; z-index:1;">Summary</span>
</div>
</body>
</html>