homepage Welcome to WebmasterWorld Guest from 23.20.77.156
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / CSS
Forum Library, Charter, Moderators: not2easy

CSS Forum

    
Fixed problem not solved :(
fixed
winpeace




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

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]

 

2lame2rank




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

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]

winpeace




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

how do I this?
how fixed ie6?
my english so bad sorry

Xapti




msg:3497266
 1:01 am on Nov 6, 2007 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / CSS
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved