WinterInChicago
09-05-2008, 08:31 PM
If I have a div that contains 6 images and each is a link, can I code those images to change the contents of another div .... similar to the properties of frames (ewww.. frames...).. so I dont have to save 6 different html files, each with a different image in that div.
There is something else I am having a problem with as well... i am going to want to have 4 columns of images that work as links. On the page you see 2 columns so far. The duped image is not an issue, I did that on purpose to test where it would go. The issue is the spacing. I tried adding padding and or margins to either column and everytime I did that, it moved the image on the right to the bottom of the first column.... why.?
http://matthewtyndall.com/supertest.html is the site.
HTML for site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dismantle Design || Graphic Design by Matthew Tyndall</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="description" content="Description" />
<meta name="keywords" content="Keywords" />
<meta name="author" content="Matthew Tyndall Dismantle Design" />
<style type="text/css" media="all">@import "css/master.css";body {
background-image: url(Images/ddimages/navbkg.jpg);
background-repeat: repeat-x;
}
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('Images/ddimages/home2.jpg','Images/ddimages/design2.jpg','Images/ddimages/web2.jpg','Images/ddimages/photography2.jpg')">
<div id="nav-container">
<img src="Images/ddimages/dismantlelogo.jpg" alt=""/><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','Images/ddimages/home2.jpg',1)"><img src="Images/ddimages/home.jpg" name="Image2" width="92" height="52" border="0" id="Image2" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','Images/ddimages/design2.jpg',1)"><img src="Images/ddimages/design.jpg" name="Image3" width="108" height="52" border="0" id="Image3" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','Images/ddimages/web2.jpg',1)"><img src="Images/ddimages/web.jpg" name="Image4" width="80" height="52" border="0" id="Image4" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','Images/ddimages/photography2.jpg',1)"><img src="Images/ddimages/photography.jpg" name="Image5" width="140" height="52" border="0" id="Image5" alt=""/></a></div>
<div id="page-container">
<div id="one"><img src="Images/ddimages/design/1.jpg" alt=""/><br /><img src="Images/ddimages/design/2.jpg" alt="" /><br /><img src="Images/ddimages/design/3.jpg" alt="" /><br /><img src="Images/ddimages/design/4.jpg" alt="" /><br /><img src="Images/ddimages/design/5.jpg" alt="" /><br /><img src="Images/ddimages/design/6.jpg" alt="" />
</div>
<div id="two"><img src="Images/ddimages/design/1.jpg" alt="" />
</div>
</div>
</body>
</html>
CSS MASTER FILE:
html, body {
margin: 0;
}
#page-container {
width: 200px;
height: 200px;
margin-top: 50px;
margin-left:28px;
background: red;
}
#one {
float: left;
width: 98px;
height: 645px;
background: white;
}
#two {
width:98px;
height: 645px;
float: left;
}
#three {
float: right;
width: 541px;
}
#four {
width:195px;
height:42px;
float:right;
}
#display {
width: 195px;
height:200px;
float: right;
}
There is something else I am having a problem with as well... i am going to want to have 4 columns of images that work as links. On the page you see 2 columns so far. The duped image is not an issue, I did that on purpose to test where it would go. The issue is the spacing. I tried adding padding and or margins to either column and everytime I did that, it moved the image on the right to the bottom of the first column.... why.?
http://matthewtyndall.com/supertest.html is the site.
HTML for site:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Dismantle Design || Graphic Design by Matthew Tyndall</title>
<meta http-equiv="Content-Language" content="en-us" />
<meta http-equiv="imagetoolbar" content="no" />
<meta name="MSSmartTagsPreventParsing" content="true" />
<meta name="description" content="Description" />
<meta name="keywords" content="Keywords" />
<meta name="author" content="Matthew Tyndall Dismantle Design" />
<style type="text/css" media="all">@import "css/master.css";body {
background-image: url(Images/ddimages/navbkg.jpg);
background-repeat: repeat-x;
}
</style>
<script type="text/JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body onload="MM_preloadImages('Images/ddimages/home2.jpg','Images/ddimages/design2.jpg','Images/ddimages/web2.jpg','Images/ddimages/photography2.jpg')">
<div id="nav-container">
<img src="Images/ddimages/dismantlelogo.jpg" alt=""/><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','Images/ddimages/home2.jpg',1)"><img src="Images/ddimages/home.jpg" name="Image2" width="92" height="52" border="0" id="Image2" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','Images/ddimages/design2.jpg',1)"><img src="Images/ddimages/design.jpg" name="Image3" width="108" height="52" border="0" id="Image3" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','Images/ddimages/web2.jpg',1)"><img src="Images/ddimages/web.jpg" name="Image4" width="80" height="52" border="0" id="Image4" alt=""/></a><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image5','','Images/ddimages/photography2.jpg',1)"><img src="Images/ddimages/photography.jpg" name="Image5" width="140" height="52" border="0" id="Image5" alt=""/></a></div>
<div id="page-container">
<div id="one"><img src="Images/ddimages/design/1.jpg" alt=""/><br /><img src="Images/ddimages/design/2.jpg" alt="" /><br /><img src="Images/ddimages/design/3.jpg" alt="" /><br /><img src="Images/ddimages/design/4.jpg" alt="" /><br /><img src="Images/ddimages/design/5.jpg" alt="" /><br /><img src="Images/ddimages/design/6.jpg" alt="" />
</div>
<div id="two"><img src="Images/ddimages/design/1.jpg" alt="" />
</div>
</div>
</body>
</html>
CSS MASTER FILE:
html, body {
margin: 0;
}
#page-container {
width: 200px;
height: 200px;
margin-top: 50px;
margin-left:28px;
background: red;
}
#one {
float: left;
width: 98px;
height: 645px;
background: white;
}
#two {
width:98px;
height: 645px;
float: left;
}
#three {
float: right;
width: 541px;
}
#four {
width:195px;
height:42px;
float:right;
}
#display {
width: 195px;
height:200px;
float: right;
}