Forum Moderators: not2easy
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head><style type="text/css">
#dynstuff {
position:fixed;
}
</style>
</head>
<script language="JavaScript1.2">
// [1]url removed credit goes to Dynamic drive[/1]
var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
var dom=document.getElementById&&navigator.userAgent.indexOf("Opera")==-1
//Specify IFRAME display attributes
var iframeprops='width=260 height=260 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
//Specify random URLs to display inside iframe
var randomcontent=new Array()
randomcontent[0]="/ab.html"
randomcontent[1]="random2.htm"
randomcontent[2]="random3.htm"
randomcontent[3]="random4.htm"
//No need to edit after here
if (ie¦¦dom)
document.write('<iframe id="dynstuff" src="" '+iframeprops+'></iframe>')
function random_iframe(){
if (ie¦¦dom){
var iframeobj=document.getElementById? document.getElementById("dynstuff") : document.all.dynstuff
iframeobj.src=randomcontent[Math.floor(Math.random()*randomcontent.length)]
}
}
window.onload=random_iframe
</script>
ie7 and mozilla fixed ok
but ie6 not fixed.
can anyone help
[edited by: SuzyUK at 12:22 am (utc) on Nov. 4, 2007]
[edit reason] Please No URI's [/edit]
I don't like a fixed position, I think it confuses users, and it doesn't work on narrow screens or smaller devices like phones.
[edited by: SuzyUK at 10:43 pm (utc) on Nov. 3, 2007]
[edit reason] Please No URI's [/edit]
I did this for a footer, so that the footer is always fixed at hte bottom of the page, but for IE6 which doesn't support it, it's FLOATed at the bottom of the document instead.
Your second option is to use javascript for IE6 which will automatically EMULATE the position:fixed CSS for you... all you need to do is include it into the page's code (in IE conditional comments), and it will do the work for you.