Inserting bground image in home page.
Posted: 13 February 2006 10:23 PM   [ Ignore ]
Newbie
Rank
Total Posts:  3
Joined  2006-02-13

I have created a page with clickable css based links that update a ‘portion’ of the home page.This(finally!) is working ok.  But I am unable to insert a single non-tiled background image for this home page-not using ‘div container’s- managed to get every working without it.

Here is the code for page….

<title>Ajax Rotating Includes script</title>
<script type=“text/javascript”>

/***********************************************
* Dynamic Ajax Content- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
***********************************************/

var loadedobjects=”“
var rootdomain=“http://”+[removed].hostname

function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject(“Msxml2.XMLHTTP”)
}
catch (e){
try{
page_request = new ActiveXObject(“Microsoft.XMLHTTP”)
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
page_request.open(‘GET’, url, true)
page_request.send(null)
}

function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || [removed].href.indexOf(“http”)==-1))
document.getElementById(containerid)[removed]=page_request.responseText
}

function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before

proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(”.css”)!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=”“){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}

[removed]

<style type=“text/css”>

body
{background:url(bg-image.jpeg) no-repeat;}

#leftcolumn

{
position:relative;
top:215px;
width:30%;
height:200px;
margin:0px;
left-border:1px solid gray;
line-height:150%;
}


.leftcolumn a
{padding: 3px;
text-decoration: bold;
text-indent: 0px;
font-weight: bold;
font-family: 12pt tahoma;
display: block;
color: black;
width: 75px;
background-color: transparent;
border-top: 0px ;
border-left: 0px #000000;
border-bottom: 0px ;
border-right: 0px}

a.one:link {color: #black}
a.one:visited {color: #0000ff}
a.one:hover {color: #ffcc00}

a.two:link {color: #ff0000}
a.two:visited {color: #0000ff}
a.two:hover {font-size: 150%}

a.three:link {color: #ff0000}
a.three:visited {color: #0000ff}
a.three:hover {background: #66ff66}

a.four:link {color: #ff0000}
a.four:visited {color: #0000ff}
a.four:hover {font-family: monospace}

a.five:link {color: #ff0000; text-decoration: none}
a.five:visited {color: #0000ff; text-decoration: none}
a.five:hover {text-decoration: none}

#rightcolumn

{position:absolute;margin-left:320px;margin-top:210px;width:60%;height:0px;
border-left:1px solid gray;padding:1em;}

* html #rightcolumn{ /*IE only style*/
height: 331px;
}

</style>
</head>
<body id=“main”>
<span>

<font face=“Tahoma,Arial, Helvetica,sans-serif”>
<div id=“rightcolumn”>

Choose a page to load.

</div>
<div style=“clear: left; margin-top: 1em”></div>
<div id=“leftcolumn”>

<p>ajaxpage(‘about.html’, ‘rightcolumn’);“class=“one” ]About <p>ajaxpage(‘home.html’, ‘rightcolumn’);“class=“one” ]Home <p>ajaxpage(‘services.html’, ‘rightcolumn’);“class=“one” ]Services Gallery <p>ajaxpage(‘links.html’, ‘rightcolumn’);“class=“one” ]Links <p>ajaxpage(‘contact.php’, ‘rightcolumn’);“class=“one” ]Contact

<div style=“margin-top: 2em”>Load CSS & JS files</div>
<a href=”[removed]loadobjs(‘ajaxfiles/style.css’, ‘ajaxfiles/tooltip.js’);”>Load “style.css” and “tooltip.js”</a>
</div>

</font>
</span>
</body>

</html>

****can some one please advise. I have tried various codes -none work.

Regards

Profile
 
 
Posted: 22 February 2006 11:52 AM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  3
Joined  2006-02-13

Fixed problem Changed the bgrnd image and worked fine. But I have noticedthat the borders of the image have been trimmed off. as if the container it’s in is to small. currently set to maximum width /height.

Profile