Welcome to WebmasterWorld Guest from 54.166.152.121

Forum Moderators: not2easy

Message Too Old, No Replies

Fixed problem not solved :(

fixed

     
8:44 pm on Nov 3, 2007 (gmt 0)

5+ Year Member



I use this code;
<!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]

9:29 pm on Nov 3, 2007 (gmt 0)

5+ Year Member



Hello, it is simple, IE 6 does not support position:fixed at all. There are many hacks around,
<snip>

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]

7:34 am on Nov 4, 2007 (gmt 0)

5+ Year Member



how do I this?
how fixed ie6?
my english so bad sorry
1:01 am on Nov 6, 2007 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



It would be best if you just put the element physically in the code about where it would be if it was fixed (typically at the start or end of the document, therefore start or end of the HTML body.) and then assign float (possibly with a clear), THEN position fixed. Most browsers will ignore the float, since the position:fixed overrides it (since it was the most recent style), but for some reason IE will revert back to the float, instead of choosing position:static or position:absolute.

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.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month