Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Fixed problem not solved :(

  1. #1
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Fixed problem not solved :(

    I use this code;
    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">
    
    //Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, and Terms Of use, visit http://dynamicdrive.com
    //This credit MUST stay intact for use
    
    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    IE 6 doesn't do:

    position:fixed;

    Sometimes, position:absolute; or relative; or just not positioning the item (which is the default and that is done as - position:static; - if it needs to be specified) for IE 6 - though definitely different and different looking than position:fixed; will be acceptable in IE 6. Otherwise, you need to use javascript and/or some kind of style gymnastics to simulate the fixed position value in IE 6.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Otherwise, you need to use javascript and/or some kind of style gymnastics to simulate the fixed position value in IE 6.
    How?Can you help me?My english is bad sorry.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Working from your example page, there is no difference between position:absolute; and position:fixed;, because there would be no scrolling. So I'm not sure what to tell you. You can do this:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    
    <style type="text/css">
    
    #dynstuff {
    position:fixed;
    }
    
    </style>
    <!--[if IE 6]>
    <style type="text/css">
    #dynstuff {
    position:absolute;
    top:expression(get_ie_top());
    left:expression(get_ie_left());
    }
    </style>
    <![endif]-->
    </head>
    <script language="JavaScript1.2">
    
    function get_ie_top(){
    return document.body.scrollTop+14+'px';
    }
    function get_ie_left(){
    return document.body.scrollLeft+10+'px';
    }
    
    //Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, and Te . . .
    But if you change your DOCTYPE to one with a valid URL, the functions would need to use document.documentElement instead of document.body.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    thank you it is ok but;
    it is like floating not fixed;why?
    ı want to likes ff and ie7 is wonderful

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Well, IE 6 doesn't do fixed. Here is an all style approach, but it can get messed up if the page needs a horizontal scrollbar, and requires a valid URL DOCTYPE:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    
    <style type="text/css">
    
    #dynstuff {
    position:fixed;
    }
    
    </style>
    <!--[if IE 6]>
    <style type="text/css">
    html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    }
    
    html {
    overflow: hidden;
    }
    body {
    overflow: auto;
    }
    
    /* to actually be fixed, this element's stacking
       context must be relative to the root element. */
    
    #dynstuff {
    position: absolute;
    top: 16px;
    left:10px
    }
    </style>
    <![endif]-->
    </head>
    <script language="JavaScript1.2">
    
    //Random iframe content- © Dynamic Drive (www.dynamicdrive.com)
    //For full source c . . .
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    problem is going on

    I want like this;but this codes not solved my problem

    http://www.url.com/search/result?goo...20IE6&q=109843

  8. #8
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Code:
    //Specify IFRAME display attributes
    var iframeprops='width=260 height=260 marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="1" scrolling="no"'
    when I change height=>620
    I add this code and your codes;
    Code:
    #dynstuff {
    	position: absolute;
    left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' );
    top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' );
    }
    but scrollbar without end don't stop(your codes too problem)
    Last edited by winpeace; 11-04-2007 at 01:21 PM.

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Are you using a strict DOCTYPE with valid URL?

    Please post a link to the page on your site that contains the problematic code so we can check it out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Nov 2006
    Posts
    65
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I use this code only;
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    Last edited by winpeace; 11-04-2007 at 02:58 PM.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •