I have a stylesheet for a "fixed in place" background image (red) and the page also does a call to a external changing image script (green).
How do I get the CSS to use the External Javascript so the "fixed in place" background image rotates on refresh?
Is it possible? Can the CSS do a call to an external .js file? - Independently these scripts work fine, but, I think they would work better if "joined"
--------------
<style type="text/css">
<!--
.bg { background-image: url(includes/backs/commonbk.gif); background-repeat: no-repeat; background-position: left top;}
//-->
</style>
------------
function change()
{
number = Math.floor(Math.random()*9)
if (number==0)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==1)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==2)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==3)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==4)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==5)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==6)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==7)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==8)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
}
-------------------- • idaryl • •
How do I get the CSS to use the External Javascript so the "fixed in place" background image rotates on refresh?
Is it possible? Can the CSS do a call to an external .js file? - Independently these scripts work fine, but, I think they would work better if "joined"
--------------
<style type="text/css">
<!--
.bg { background-image: url(includes/backs/commonbk.gif); background-repeat: no-repeat; background-position: left top;}
//-->
</style>
------------
function change()
{
number = Math.floor(Math.random()*9)
if (number==0)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==1)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==2)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==3)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==4)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==5)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==6)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
if (number==7)
document.write('<img src="includes/backs/commonbk.gif" width="747" height="358" border="0">')
if (number==8)
document.write('<img src="includes/backs/persbk.gif" width="747" height="358" border="0">')
}
-------------------- • idaryl • •